diff --git a/src/gs-entbase/server/func_healthcharger.qc b/src/gs-entbase/server/func_healthcharger.qc index ca3a1abc..3e2096d9 100644 --- a/src/gs-entbase/server/func_healthcharger.qc +++ b/src/gs-entbase/server/func_healthcharger.qc @@ -135,7 +135,7 @@ void func_healthcharger::Respawn(void) { SetSolid(SOLID_BSP); - SetMovetype(MOVETYPE_PUSH); + SetMovetype(MOVETYPE_NONE); SetOrigin(GetSpawnOrigin()); SetModel(GetSpawnModel()); PlayerUse = OnPlayerUse; @@ -146,7 +146,7 @@ void func_healthcharger::ResetHealth(void) { if (health <= 0) { - sound(this, CHAN_VOICE, m_strSndFirst, 1.0, ATTN_NORM); + StartSound(m_strSndFirst, CHAN_VOICE, 0, true); } SetFrame(0); @@ -167,25 +167,27 @@ func_healthcharger::OnPlayerUse(void) return; /* First time */ - if (m_eUser == world) - sound(this, CHAN_VOICE, m_strSndFirst, 1.0, ATTN_NORM); + if (m_eUser == world) { + StartSound(m_strSndFirst, CHAN_VOICE, 0, true); + } - if (m_flDelay > time) + if (m_flDelay > GetTime()) return; if (health <= 0) { eActivator.flags &= ~FL_USE_RELEASED; - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); m_eUser = world; return; } if (eActivator.health >= 100) { eActivator.flags &= ~FL_USE_RELEASED; - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); } else { - if (m_eUser == world) - sound(this, CHAN_ITEM, m_strSndCharging, 1.0, ATTN_NORM); + if (m_eUser == world) { + StartSound(m_strSndCharging, CHAN_ITEM, 0, true); + } eActivator.health = bound(0, eActivator.health += 1, 100); @@ -197,8 +199,8 @@ func_healthcharger::OnPlayerUse(void) /* Disable when empty */ if (health <= 0) { - sound(this, CHAN_ITEM, "common/null.wav", 1.0, ATTN_NORM); - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StopSound(CHAN_ITEM, true); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); SetFrame(1); eActivator.flags &= ~FL_USE_RELEASED; m_eUser = world; @@ -207,26 +209,20 @@ func_healthcharger::OnPlayerUse(void) } m_eUser = eActivator; - m_flDelay = time + 0.1f; - m_flCheck = time + 0.25f; + m_flDelay = GetTime() + 0.1f; + m_flCheck = GetTime() + 0.25f; } void func_healthcharger::customphysics(void) { - if (m_flCheck > time) + if (m_flCheck > GetTime()) return; if (m_eUser) { - sound(this, CHAN_ITEM, "common/null.wav", 1.0, ATTN_NORM); + StopSound(CHAN_ITEM, true); m_eUser = world; } - /* support for think/nextthink */ - if (think && nextthink > 0.0f) { - if (nextthink < time) { - nextthink = 0.0f; - think(); - } - } + HandleThink(); } diff --git a/src/gs-entbase/server/func_recharge.qc b/src/gs-entbase/server/func_recharge.qc index 368eb477..5b2b637b 100644 --- a/src/gs-entbase/server/func_recharge.qc +++ b/src/gs-entbase/server/func_recharge.qc @@ -136,7 +136,7 @@ void func_recharge::Respawn(void) { SetSolid(SOLID_BSP); - SetMovetype(MOVETYPE_PUSH); + SetMovetype(MOVETYPE_NONE); SetOrigin(GetSpawnOrigin()); SetModel(GetSpawnModel()); PlayerUse = OnPlayerUse; @@ -147,7 +147,7 @@ void func_recharge::ResetHealth(void) { if (health <= 0) { - sound(this, CHAN_VOICE, m_strSndFirst, 1.0, ATTN_NORM); + StartSound(m_strSndFirst, CHAN_VOICE, 0, true); } SetFrame(0); @@ -175,16 +175,16 @@ func_recharge::OnPlayerUse(void) /* First time */ if (m_eUser == world) { - sound(this, CHAN_VOICE, m_strSndFirst, 1.0, ATTN_NORM); + StartSound(m_strSndFirst, CHAN_VOICE, 0, true); } - if (m_flDelay > time) { + if (m_flDelay > GetTime()) { return; } if (health <= 0) { eActivator.flags &= ~FL_USE_RELEASED; - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); m_eUser = world; return; } @@ -192,11 +192,12 @@ func_recharge::OnPlayerUse(void) NSClientPlayer pl = (NSClientPlayer)eActivator; if (pl.armor >= 100) { eActivator.flags &= ~FL_USE_RELEASED; - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); } else { if (m_eUser == world) { - sound(this, CHAN_ITEM, m_strSndCharging, 1.0, ATTN_NORM); + StartSound(m_strSndCharging, CHAN_ITEM, 0, true); } + pl.armor = bound(0, pl.armor += 1, 100); /* Reset 30 seconds after first being used successfully */ @@ -207,8 +208,8 @@ func_recharge::OnPlayerUse(void) /* Disable when empty */ if (health <= 0) { - sound(this, CHAN_ITEM, "common/null.wav", 1.0, ATTN_NORM); - sound(this, CHAN_VOICE, m_strSndDone, 1.0, ATTN_NORM); + StopSound(CHAN_ITEM, true); + StartSound(m_strSndDone, CHAN_VOICE, 0, true); SetFrame(1); eActivator.flags &= ~FL_USE_RELEASED; m_eUser = world; @@ -217,14 +218,14 @@ func_recharge::OnPlayerUse(void) } m_eUser = eActivator; - m_flDelay = time + 0.1f; - m_flCheck = time + 0.25f; + m_flDelay = GetTime() + 0.1f; + m_flCheck = GetTime() + 0.25f; } void func_recharge::customphysics(void) { - if (m_flCheck > time) { + if (m_flCheck > GetTime()) { return; } @@ -233,11 +234,5 @@ func_recharge::customphysics(void) m_eUser = world; } - /* support for think/nextthink */ - if (think && nextthink > 0.0f) { - if (nextthink < time) { - nextthink = 0.0f; - think(); - } - } + HandleThink(); } diff --git a/src/gs-entbase/shared/func_vehicle.qc b/src/gs-entbase/shared/func_vehicle.qc index 13a13df1..20695b7c 100644 --- a/src/gs-entbase/shared/func_vehicle.qc +++ b/src/gs-entbase/shared/func_vehicle.qc @@ -819,7 +819,7 @@ func_vehicle::RunVehiclePhysics(void) angles[1] = Math_FixDelta(angles[1]); angles[2] = Math_FixDelta(angles[2]); angles[0] = bound (-45, angles[0], 45); - angles[2] = bound (-45, angles[2], 45); + angles[2] = bound (-15, angles[2], 15); velocity[0] = bound(-1000, velocity[0], 1000); velocity[1] = bound(-1000, velocity[1], 1000); diff --git a/src/gs-entbase/shared/trigger_camera.qc b/src/gs-entbase/shared/trigger_camera.qc index 928c469d..0782bf0e 100644 --- a/src/gs-entbase/shared/trigger_camera.qc +++ b/src/gs-entbase/shared/trigger_camera.qc @@ -71,6 +71,9 @@ trigger_camera::trigger_camera(void) { #ifndef CLIENT m_flWait = 4.0f; + m_strAimAt = __NULL__; + m_strMoveTo = __NULL__; + m_eLooker = __NULL__; #endif } @@ -136,6 +139,7 @@ trigger_camera::Respawn(void) SetMovetype(MOVETYPE_PUSH); SetModel(GetSpawnModel()); SetOrigin(GetSpawnOrigin()); + m_eLooker = world; } float @@ -144,8 +148,9 @@ trigger_camera::SendEntity(entity ePEnt, float flFlags) if (clienttype(ePEnt) != CLIENTTYPE_REAL) return (0); - if (ePEnt != m_eLooker) + if (ePEnt != m_eLooker) { return (0); + } WriteByte(MSG_ENTITY, ENT_OLDCAMERA); WriteFloat(MSG_ENTITY, flFlags); @@ -206,20 +211,12 @@ trigger_camera::GoToTarget(void) if (!flTravelTime) { print("^1trigger_camera::^3GoToTarget^7: Distance short, going next\n"); - think = NextPath; - - /* because ltime may be 0 */ - if (!ltime) - nextthink = ltime + 0.001f; - else - nextthink = ltime; - + ScheduleThink(NextPath, 0.0f); return; } - velocity = (vecVelocity * (1 / flTravelTime)); - think = NextPath; - nextthink = (ltime + flTravelTime); + SetVelocity(vecVelocity * (1 / flTravelTime)); + ScheduleThink(NextPath, flTravelTime); } void @@ -236,15 +233,13 @@ trigger_camera::NextPath(void) eNode.Trigger(this, TRIG_TOGGLE); SetOrigin(eNode.origin - (mins + maxs) * 0.5); - - target = eNode.target; - velocity = [0,0,0]; + SetTriggerTarget(eNode.target); + ClearVelocity(); /* warp next frame */ if (eNode.HasSpawnFlags(PC_TELEPORT)) { print(sprintf("^1trigger_camera::^3NextPath^7: Node %s wants %s to teleport\n", eNode.targetname, targetname)); - think = NextPath; - nextthink = ltime; + ScheduleThink(NextPath, 0.0f); return; } @@ -254,8 +249,7 @@ trigger_camera::NextPath(void) } if (eNode.m_flWait > 0) { - think = GoToTarget; - nextthink = ltime + eNode.m_flWait; + ScheduleThink(GoToTarget, eNode.m_flWait); } else { GoToTarget(); } @@ -266,12 +260,11 @@ void trigger_camera::Trigger(entity act, int state) { m_eLooker = act; - + NSLog("Triggering it on %s\n", act.netname); SetOrigin(GetSpawnOrigin()); - velocity = [0,0,0]; - think = __NULL__; - nextthink = 0.0f; - target = m_strMoveTo; + ClearVelocity(); + ReleaseThink(); + SetTriggerTarget(m_strMoveTo); NextPath(); GoToTarget(); SetSendFlags(OCAMFL_CHANGED_ORIGIN | OCAMFL_CHANGED_ANGLES | OCAMFL_CHANGED_WAIT); diff --git a/src/shared/NSEntity.h b/src/shared/NSEntity.h index 389ebbac..b211d9be 100644 --- a/src/shared/NSEntity.h +++ b/src/shared/NSEntity.h @@ -106,39 +106,39 @@ class NSEntity:NSTrigger virtual float(entity, float) SendEntity; nonvirtual entity(void) GetParent; - virtual void(string) SetParent; - virtual void(string) SetParentAttachment; - virtual void(void) ClearParent; + nonvirtual void(string) SetParent; + nonvirtual void(string) SetParentAttachment; + nonvirtual void(void) ClearParent; virtual void(void) ParentUpdate; /* some ents need this */ - virtual void(void) RestoreAngles; - virtual void(void) ClearAngles; + nonvirtual void(void) RestoreAngles; + nonvirtual void(void) ClearAngles; #endif /* sets */ - virtual void(float) SetEffects; - virtual void(float) SetFrame; - virtual void(float) SetSkin; - virtual void(float) SetScale; - virtual void(entity) SetOwner; - virtual void(vector) SetVelocity; - virtual void(void()) SetTouch; - virtual void(float) SetSendFlags; - virtual void(float) SetSolid; - virtual void(string) SetModel; - virtual void(float) SetModelindex; - virtual void(float) SetMovetype; - virtual void(float) SetGravity; - virtual void(vector) SetAngles; - virtual void(vector) SetAngularVelocity; - virtual void(vector) SetOrigin; - virtual void(vector, vector) SetSize; - virtual void(float) AddFlags; - virtual void(float) RemoveFlags; - virtual void(void()) SetThink; - virtual void(float) SetNextThink; - virtual void(void(void), float) ScheduleThink; + nonvirtual void(float) SetEffects; + nonvirtual void(float) SetFrame; + nonvirtual void(float) SetSkin; + nonvirtual void(float) SetScale; + nonvirtual void(entity) SetOwner; + nonvirtual void(vector) SetVelocity; + nonvirtual void(void()) SetTouch; + nonvirtual void(float) SetSendFlags; + nonvirtual void(float) SetSolid; + nonvirtual void(string) SetModel; + nonvirtual void(float) SetModelindex; + nonvirtual void(float) SetMovetype; + nonvirtual void(float) SetGravity; + nonvirtual void(vector) SetAngles; + nonvirtual void(vector) SetAngularVelocity; + nonvirtual void(vector) SetOrigin; + nonvirtual void(vector, vector) SetSize; + nonvirtual void(float) AddFlags; + nonvirtual void(float) RemoveFlags; + nonvirtual void(void()) SetThink; + nonvirtual void(float) SetNextThink; + nonvirtual void(void(void), float) ScheduleThink; /* gets */ nonvirtual vector(void) GetSpawnOrigin; @@ -172,20 +172,20 @@ class NSEntity:NSTrigger nonvirtual void(void) ClearVelocity; /* drawing related */ - virtual void(void) Show; - virtual void(void) Hide; + nonvirtual void(void) Show; + nonvirtual void(void) Hide; nonvirtual bool(void) IsHidden; /* this will not just hide an entity, it'll make it disappear from the game, but not deallocated it */ - virtual void(void) Disappear; + nonvirtual void(void) Disappear; virtual void(string, string) SpawnKey; - virtual void(void) Destroy; - virtual void(void) UpdateBounds; + nonvirtual void(void) Destroy; + nonvirtual void(void) UpdateBounds; - /* useful methods, based on GMod's API */ + /* useful methods, (some) based on GMod's API */ nonvirtual float(void) EntIndex; - virtual void(void) DropToFloor; + nonvirtual void(void) DropToFloor; nonvirtual vector(void) GetForward; nonvirtual vector(void) GetRight; nonvirtual vector(void) GetUp; @@ -199,14 +199,20 @@ class NSEntity:NSTrigger nonvirtual bool(void) CreatedByMap; nonvirtual bool(entity) WithinBounds; + /* useful methods, (some) based on Doom 3's API */ + nonvirtual bool(string, float, float, bool) StartSound; + nonvirtual bool(string, float, bool) StartSoundDef; + nonvirtual void(float, bool) StopSound; + nonvirtual float(void) GetTime; + virtual void(entity) Blocked; virtual void(entity) StartTouch; virtual void(entity) Touch; virtual void(entity) EndTouch; - virtual void(void) _TouchHandler; - virtual void(void) _BlockedHandler; + nonvirtual void(void) _TouchHandler; + nonvirtual void(void) _BlockedHandler; + nonvirtual void(void) HandleThink; virtual void(void) OnRemoveEntity; - virtual void(void) MakeStatic; }; diff --git a/src/shared/NSEntity.qc b/src/shared/NSEntity.qc index 935a66b4..34ddd826 100644 --- a/src/shared/NSEntity.qc +++ b/src/shared/NSEntity.qc @@ -256,7 +256,7 @@ NSEntity::_TouchHandler(void) Touch(other); - m_flTouchTime = time; + m_flTouchTime = GetTime(); m_beingTouched = true; m_eTouchLast = other; } @@ -441,7 +441,7 @@ NSEntity::ParentUpdate(void) /* handle end-touch */ if (m_beingTouched == true) - if (m_flTouchTime < time) { + if (m_flTouchTime < GetTime()) { EndTouch(m_eTouchLast); m_beingTouched = false; m_eTouchLast = __NULL__; @@ -688,10 +688,7 @@ noref .float ltime; void NSEntity::SetNextThink(float fl) { - float flTime; - - /* thinks work differently for pushmovables */ - flTime = (movetype == MOVETYPE_PUSH) ? ltime : time; + float flTime = GetTime(); /* HACK: to make sure things happen post-spawn */ if (flTime <= 0.0f) @@ -863,10 +860,7 @@ NSEntity::GetNextThinkTime(void) bool NSEntity::IsThinking(void) { - if (movetype == MOVETYPE_PUSH) - return (nextthink > ltime) ? true : false; - else - return (nextthink > time) ? true : false; + return (nextthink > GetTime()) ? true : false; } void @@ -979,16 +973,15 @@ NSEntity::Input(entity eAct, string strInput, string strData) switch (strInput) { case "Kill": think = Util_Destroy; - nextthink = time; + nextthink = GetTime(); break; case "KillHierarchy": /* this works because ents are basically just entnums */ for (entity e = world; (e=findfloat(e, ::owner, this));) { - e.think = Util_Destroy; - e.nextthink = time; + NSEntity ent = (NSEntity)e; + ent.Destroy(); } - think = Util_Destroy; - nextthink = time; + Destroy(); break; case "SetParent": SetParent(strData); @@ -1086,14 +1079,16 @@ through your own hoops. This however will be sufficient 99,99% of the time. void NSEntity::Destroy(void) { + float flTime = GetTime(); + OnRemoveEntity(); think = Util_Destroy; - if (!time) - nextthink = time + 0.01; + if (!flTime) + nextthink = flTime + 0.01; else - nextthink = time; + nextthink = flTime; } void @@ -1139,3 +1134,43 @@ NSEntity::WithinBounds(entity check) return true; } + +bool +NSEntity::StartSound(string strSample, float channel, float flags, bool broadcast) +{ + if not (whichpack(strcat("sound/", strSample))) + return false; + + sound(this, channel, strSample, 1.0, ATTN_NORM); + return true; +} + +bool +NSEntity::StartSoundDef(string strSample, float channel, bool broadcast) +{ + Sound_Play(this, channel, strSample); +} + +void +NSEntity::StopSound(float channel, bool broadcast) +{ + sound(this, channel, "common/null.wav", 0.1f, ATTN_NORM); +} + +void +NSEntity::HandleThink(void) +{ + /* support for think/nextthink */ + if (think && nextthink > 0.0f) { + if (nextthink < time) { + nextthink = 0.0f; + think(); + } + } +} + +float +NSEntity::GetTime(void) +{ + return (movetype == MOVETYPE_PUSH) ? ltime : time; +} \ No newline at end of file diff --git a/src/shared/NSIO.h b/src/shared/NSIO.h index 0ca74e59..f644b03d 100644 --- a/src/shared/NSIO.h +++ b/src/shared/NSIO.h @@ -43,28 +43,28 @@ class NSIO string m_strOnUser4; /* helper functions to allocate outputs */ - virtual void(entity, string) UseOutput; - virtual string(string, string) PrepareOutput; - virtual string(string) CreateOutput; + nonvirtual void(entity, string) UseOutput; + nonvirtual string(string, string) PrepareOutput; + nonvirtual string(string) CreateOutput; virtual void(float) Save; virtual void(string,string) Restore; /* save game */ - virtual void(float, string, float) SaveFloat; - virtual void(float, string, int) SaveInt; - virtual void(float, string, string) SaveString; - virtual void(float, string, vector) SaveVector; - virtual void(float, string, bool) SaveBool; - virtual void(float, string, entity) SaveEntity; + nonvirtual void(float, string, float) SaveFloat; + nonvirtual void(float, string, int) SaveInt; + nonvirtual void(float, string, string) SaveString; + nonvirtual void(float, string, vector) SaveVector; + nonvirtual void(float, string, bool) SaveBool; + nonvirtual void(float, string, entity) SaveEntity; /* load game */ - virtual float(string) ReadFloat; - virtual int(string) ReadInt; - virtual string(string) ReadString; - virtual vector(string) ReadVector; - virtual bool(string) ReadBool; - virtual entity(string) ReadEntity; + nonvirtual float(string) ReadFloat; + nonvirtual int(string) ReadInt; + nonvirtual string(string) ReadString; + nonvirtual vector(string) ReadVector; + nonvirtual bool(string) ReadBool; + nonvirtual entity(string) ReadEntity; /* Handle incoming entities input messaging */ virtual void(entity, string, string) Input; diff --git a/src/shared/NSMonster.h b/src/shared/NSMonster.h index c9b64181..c037bc43 100644 --- a/src/shared/NSMonster.h +++ b/src/shared/NSMonster.h @@ -300,7 +300,7 @@ class NSMonster:NSNavAI /* states */ virtual void(monsterState_t, monsterState_t) StateChanged; - virtual void(monsterState_t) SetState; + nonvirtual void(monsterState_t) SetState; nonvirtual monsterState_t(void) GetState; /* TriggerTarget/Condition */ diff --git a/src/shared/NSPhysicsEntity.h b/src/shared/NSPhysicsEntity.h index 717247eb..534e37df 100644 --- a/src/shared/NSPhysicsEntity.h +++ b/src/shared/NSPhysicsEntity.h @@ -81,19 +81,19 @@ class NSPhysicsEntity:NSSurfacePropEntity #endif virtual void(string, string) SpawnKey; - virtual void(float) SetMass; + nonvirtual void(float) SetMass; nonvirtual float(void) GetMass; - virtual void(float) SetFriction; + nonvirtual void(float) SetFriction; nonvirtual float(void) GetFriction; - virtual void(float) SetBounceFactor; + nonvirtual void(float) SetBounceFactor; nonvirtual float(void) GetBounceFactor; - virtual void(float) SetBounceStop; + nonvirtual void(float) SetBounceStop; nonvirtual float(void) GetBounceStop; - virtual void(void) PhysicsEnable; - virtual void(void) PhysicsDisable; - virtual void(vector) ApplyForceCenter; - virtual void(vector, vector) ApplyForceOffset; - virtual void(vector) ApplyTorqueCenter; + nonvirtual void(void) PhysicsEnable; + nonvirtual void(void) PhysicsDisable; + nonvirtual void(vector) ApplyForceCenter; + nonvirtual void(vector, vector) ApplyForceOffset; + nonvirtual void(vector) ApplyTorqueCenter; nonvirtual float(int, int) CalculateImpactDamage; }; diff --git a/src/shared/NSRenderableEntity.h b/src/shared/NSRenderableEntity.h index 6ea7f83f..c86b43d0 100644 --- a/src/shared/NSRenderableEntity.h +++ b/src/shared/NSRenderableEntity.h @@ -125,16 +125,16 @@ class NSRenderableEntity:NSEntity PREDICTED_VECTOR(m_vecRenderColor); /* set */ - virtual void(int) SetBody; - virtual void(float) SetRenderFX; - virtual void(float) SetRenderMode; - virtual void(float) SetRenderAmt; - virtual void(vector) SetRenderColor; - virtual void(float) SetBoneControl1; - virtual void(float) SetBoneControl2; - virtual void(float) SetBoneControl3; - virtual void(float) SetBoneControl4; - virtual void(float) SetBoneControl5; + nonvirtual void(int) SetBody; + nonvirtual void(float) SetRenderFX; + nonvirtual void(float) SetRenderMode; + nonvirtual void(float) SetRenderAmt; + nonvirtual void(vector) SetRenderColor; + nonvirtual void(float) SetBoneControl1; + nonvirtual void(float) SetBoneControl2; + nonvirtual void(float) SetBoneControl3; + nonvirtual void(float) SetBoneControl4; + nonvirtual void(float) SetBoneControl5; nonvirtual int(void) GetBody; nonvirtual float(void) GetRenderMode; @@ -148,7 +148,7 @@ class NSRenderableEntity:NSEntity nonvirtual float(void) GetBoneControl5; #ifdef CLIENT - virtual void(void) RenderFXPass; + nonvirtual void(void) RenderFXPass; #else /* respawn */ float m_oldiRenderFX; diff --git a/src/shared/NSSurfacePropEntity.h b/src/shared/NSSurfacePropEntity.h index 27ff2383..933f2500 100644 --- a/src/shared/NSSurfacePropEntity.h +++ b/src/shared/NSSurfacePropEntity.h @@ -75,9 +75,9 @@ class NSSurfacePropEntity:NSRenderableEntity /* I/O */ string m_strOnBreak; - virtual void(entity, float, int) Ignite; - virtual void(void) Extinguish; - virtual bool(void) IsOnFire; + nonvirtual void(entity, float, int) Ignite; + nonvirtual void(void) Extinguish; + nonvirtual bool(void) IsOnFire; /* life, death */ float m_oldHealth; @@ -86,31 +86,31 @@ class NSSurfacePropEntity:NSRenderableEntity virtual bool(void) IsAlive; /* Generic Damage */ - virtual void(float) SetTakedamage; - virtual void(float) SetHealth; - virtual void(float) SetMaxHealth; - virtual float(void) GetHealth; - virtual float(void) GetMaxHealth; + nonvirtual void(float) SetTakedamage; + nonvirtual void(float) SetHealth; + nonvirtual void(float) SetMaxHealth; + nonvirtual float(void) GetHealth; + nonvirtual float(void) GetMaxHealth; /* Surface/PropKit */ int m_iMaterial; int m_iPropData; - virtual float(void) GetSpawnHealth; - virtual bool(void) HasPropData; - virtual __variant(int) GetPropData; - virtual bool(void) HasSurfaceData; - virtual __variant(int) GetSurfaceData; + nonvirtual float(void) GetSpawnHealth; + nonvirtual bool(void) HasPropData; + nonvirtual __variant(int) GetPropData; + nonvirtual bool(void) HasSurfaceData; + nonvirtual __variant(int) GetSurfaceData; string m_strSurfData; string m_strPropData; - virtual void(string) SetSurfaceData; - virtual void(string) SetPropData; - virtual void(void) SurfaceDataFinish; - virtual void(void) PropDataFinish; + nonvirtual void(string) SetSurfaceData; + nonvirtual void(string) SetPropData; + nonvirtual void(void) SurfaceDataFinish; + nonvirtual void(void) PropDataFinish; #endif /* misc 'being' methods */ - virtual vector(void) GetEyePos; + nonvirtual vector(void) GetEyePos; }; #ifdef CLIENT diff --git a/src/shared/NSTrigger.h b/src/shared/NSTrigger.h index 29249967..5ea9d089 100644 --- a/src/shared/NSTrigger.h +++ b/src/shared/NSTrigger.h @@ -49,8 +49,8 @@ class NSTrigger:NSIO /* legacy trigger architecture */ float m_flDelay; virtual void(entity, int) Trigger; - virtual void(entity, int, float) UseTargets; - virtual void(string) SetTriggerTarget; + nonvirtual void(entity, int, float) UseTargets; + nonvirtual void(string) SetTriggerTarget; /* master feature */ nonvirtual int(void) GetValue; diff --git a/src/shared/NSVehicle.qc b/src/shared/NSVehicle.qc index d18dd60c..5351b63d 100644 --- a/src/shared/NSVehicle.qc +++ b/src/shared/NSVehicle.qc @@ -406,7 +406,6 @@ NSVehicle::PlayerAlign(void) vecPlayerPos = origin + v_forward * m_vecPlayerPos[0]; vecPlayerPos += v_right * m_vecPlayerPos[1]; vecPlayerPos += v_up * m_vecPlayerPos[2]; - setorigin(m_eDriver, vecPlayerPos); }