NSVehicle: Add the following methods - HidePlayermodel (for the self-driver) and DriverAnimation. The latter is a gentle request and the mod doesn't have to respect it, but should be used as a fallback.
This commit is contained in:
parent
a469c06fc8
commit
6a658c5268
4 changed files with 21 additions and 2 deletions
|
@ -62,12 +62,18 @@ player::predraw(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (this_us && flags & FL_INVEHICLE) {
|
||||
NSVehicle veh = (NSVehicle)vehicle;
|
||||
if (veh)
|
||||
this_us = veh.HidePlayermodel();
|
||||
}
|
||||
|
||||
if (autocvar_cl_thirdperson == TRUE || !this_us) {
|
||||
Voice_Draw3D(this);
|
||||
Player_PreDraw(this, TRUE);
|
||||
if (p_model)
|
||||
addentity(p_model);
|
||||
addentity(this);
|
||||
//addentity(this);
|
||||
} else {
|
||||
Player_PreDraw(this, FALSE);
|
||||
if (p_model)
|
||||
|
|
|
@ -208,7 +208,7 @@ NSMonster::SeeThink(void)
|
|||
traceline(origin, w.origin, MOVE_EVERYTHING, this);
|
||||
|
||||
/* we have line of sight with the player */
|
||||
if (trace_fraction == 1.0f) {
|
||||
if (trace_fraction == 1.0f || trace_ent == w) {
|
||||
if (m_eEnemy != w) {
|
||||
m_eEnemy = w;
|
||||
AlertNearby();
|
||||
|
|
|
@ -45,6 +45,7 @@ class NSVehicle:NSSurfacePropEntity
|
|||
virtual void(void) UpdateView;
|
||||
virtual bool(void) HideViewWeapon;
|
||||
virtual bool(void) HideCrosshair;
|
||||
virtual bool(void) HidePlayermodel;
|
||||
#else
|
||||
virtual vector(void) GetExitPos;
|
||||
virtual void(void) EvaluateEntity;
|
||||
|
@ -57,6 +58,7 @@ class NSVehicle:NSSurfacePropEntity
|
|||
virtual void(base_player) PlayerEnter;
|
||||
virtual void(base_player) PlayerLeave;
|
||||
virtual void() PlayerInput;
|
||||
virtual float(void) DriverAnimation;
|
||||
};
|
||||
|
||||
enumflags
|
||||
|
|
|
@ -14,6 +14,12 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
float
|
||||
NSVehicle::DriverAnimation(void)
|
||||
{
|
||||
return (-1);
|
||||
}
|
||||
|
||||
entity
|
||||
NSVehicle::GetDriver(void)
|
||||
{
|
||||
|
@ -31,6 +37,11 @@ NSVehicle::HideCrosshair(void)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
bool
|
||||
NSVehicle::HidePlayermodel(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
NSVehicle::DriverRelink(void)
|
||||
|
|
Loading…
Reference in a new issue