Fix a bunch of nonvirtual/virtual mismatching going on that's been caught by the new compiler.

This commit is contained in:
Marco Cawthorne 2022-11-16 14:04:10 -08:00
parent ecf5988584
commit 2265047bfe
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
12 changed files with 473 additions and 668 deletions

View File

@ -48,6 +48,7 @@ enumflags
class prop_vehicle_driveable_wheel
{
void() prop_vehicle_driveable_wheel;
float m_flSuspension;
float m_flSuspensionForce;
@ -122,6 +123,50 @@ class prop_vehicle_driveable:NSVehicle
virtual float(entity, float) SendEntity;
#endif
};
void
prop_vehicle_driveable::prop_vehicle_driveable(void)
{
m_eDriver = __NULL__;
m_flBounceFactor = 1.25f;
m_flAcceleration = 600.0f;
m_flSkidSpeed = 256.0f;
m_flTraction = 5.0f;
m_flBreakFactor = 2.0f;
m_flSteerFactor = 1.0f;
m_flStraightenFactor = 1.0f;
m_vecGravityDir = [0,0,-1];
m_iVehicleFlags |= VHF_FROZEN;
hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP;
if (!m_eCollBox1)
m_eCollBox1 = spawn(NSEntity);
if (!m_eCollBox2)
m_eCollBox2 = spawn(NSEntity);
{
m_eCollBox1.SetSize([-32,-32,0], [32,32,32]);
m_eCollBox2.SetSize([-32,-32,0], [32,32,32]);
}
m_eCollBox1.hitcontentsmaski = hitcontentsmaski;
m_eCollBox2.hitcontentsmaski = hitcontentsmaski;
if (!m_wlFL)
m_wlFL = spawn(prop_vehicle_driveable_wheel);
if (!m_wlFR)
m_wlFR = spawn(prop_vehicle_driveable_wheel);
if (!m_wlBL)
m_wlBL = spawn(prop_vehicle_driveable_wheel);
if (!m_wlBR)
m_wlBR = spawn(prop_vehicle_driveable_wheel);
m_eCollBox1.owner = m_eCollBox2.owner = \
m_wlFL.owner = m_wlFR.owner = \
m_wlBL.owner = m_wlBR.owner = this;
customphysics = Physics;
}
#ifdef CLIENT
bool
@ -853,50 +898,6 @@ prop_vehicle_driveable::Spawned(void)
#endif
}
void
prop_vehicle_driveable::prop_vehicle_driveable(void)
{
m_eDriver = __NULL__;
m_flBounceFactor = 1.25f;
m_flAcceleration = 600.0f;
m_flSkidSpeed = 256.0f;
m_flTraction = 5.0f;
m_flBreakFactor = 2.0f;
m_flSteerFactor = 1.0f;
m_flStraightenFactor = 1.0f;
m_vecGravityDir = [0,0,-1];
m_iVehicleFlags |= VHF_FROZEN;
hitcontentsmaski = CONTENTBIT_BODY | CONTENTBITS_POINTSOLID | CONTENTBIT_VEHICLECLIP;
if (!m_eCollBox1)
m_eCollBox1 = spawn(NSEntity);
if (!m_eCollBox2)
m_eCollBox2 = spawn(NSEntity);
{
m_eCollBox1.SetSize([-32,-32,0], [32,32,32]);
m_eCollBox2.SetSize([-32,-32,0], [32,32,32]);
}
m_eCollBox1.hitcontentsmaski = hitcontentsmaski;
m_eCollBox2.hitcontentsmaski = hitcontentsmaski;
if (!m_wlFL)
m_wlFL = spawn(prop_vehicle_driveable_wheel);
if (!m_wlFR)
m_wlFR = spawn(prop_vehicle_driveable_wheel);
if (!m_wlBL)
m_wlBL = spawn(prop_vehicle_driveable_wheel);
if (!m_wlBR)
m_wlBR = spawn(prop_vehicle_driveable_wheel);
m_eCollBox1.owner = m_eCollBox2.owner = \
m_wlFL.owner = m_wlFR.owner = \
m_wlBL.owner = m_wlBR.owner = this;
customphysics = Physics;
}
#ifdef CLIENT
void
prop_vehicle_driveable_readentity(float isnew)

View File

@ -115,6 +115,9 @@ public:
virtual void Save(float);
virtual void Restore(string,string);
/** Called when we need to re-align the entity to our parent entity. */
virtual void ParentUpdate(void);
/** Called when the entity has been successfully restored from a savegame file. */
virtual void RestoreComplete(void);
@ -136,9 +139,6 @@ public:
/** Call this on an entity to remove the connection to its parent. */
nonvirtual void ClearParent(void);
/** Called when we need to re-align the entity to our parent entity. */
virtual void ParentUpdate(void);
/** Restore the entity's angles to the value they spawned with. */
nonvirtual void RestoreAngles(void);
@ -172,7 +172,7 @@ public:
/** Sets the collision type of the entity. Check the solid_t enum for available types. */
nonvirtual void SetSolid(float);
/** Sets the 3D model representation of the entity from a file path and name. */
nonvirtual void SetModel(string);
virtual void SetModel(string);
/** Sets the 3D model representation of the entity from an already precached resource id. */
nonvirtual void SetModelindex(float);
/** Sets the movement type of the entity. Check the movetype_t enum for available types. */

File diff suppressed because it is too large Load Diff

View File

@ -55,14 +55,21 @@ public:
that are part of NSIO. */
virtual void SpawnKey(string,string);
/** Get the level time the entity finds itself in.
Always use this instead of the `time` global. The `time` global may not
be valid on every type of entity. Specifically, MOVETYPE_PUSH entities only
update upon movement (so that any think timers the entity may have are not triggered
when it is at rest. */
nonvirtual float GetTime(void);
#ifdef SERVER
/** Handles saving a copy of this entity to a given filehandle.
Within you want to use the ::SaveFloat() etc. methods to write
the internal member attributes to the specified file handle. */
virtual void Save(float);
/** Similar to `::SpawnKey` but for save-game fields.
Whatever you write into file handles within your `::Save()` method
needs to be read back in here. */
virtual void Restore(string,string);
/** Called when we are being prompted by another object/function with an input message. */
virtual void Input(entity,string,string);
/* helper functions to allocate outputs */
/** Triggers an output field that has been created beforehand */
nonvirtual void UseOutput(entity,string);
@ -80,16 +87,6 @@ public:
Input/Output specification. */
nonvirtual string CreateOutput(string);
/** Handles saving a copy of this entity to a given filehandle.
Within you want to use the ::SaveFloat() etc. methods to write
the internal member attributes to the specified file handle. */
virtual void Save(float);
/** Similar to `::SpawnKey` but for save-game fields.
Whatever you write into file handles within your `::Save()` method
needs to be read back in here. */
virtual void Restore(string,string);
/* save game related methods */
/** Saves a floating point key/value pair to a filehandle. */
nonvirtual void SaveFloat(float,string,float);
@ -117,10 +114,14 @@ public:
nonvirtual bool ReadBool(string);
/** read an entity id, converted to entity, from a string */
nonvirtual entity ReadEntity(string);
/** Called when we are being prompted by another object/function with an input message. */
virtual void Input(entity,string,string);
#endif
/** Get the level time the entity finds itself in.
Always use this instead of the `time` global. The `time` global may not
be valid on every type of entity. Specifically, MOVETYPE_PUSH entities only
update upon movement (so that any think timers the entity may have are not triggered
when it is at rest. */
nonvirtual float GetTime(void);
};
.bool _mapspawned;

View File

@ -272,7 +272,7 @@ public:
virtual void EvaluateEntity(void);
virtual float SendEntity(entity,float);
virtual void Touch(entity);
virtual void Hide(void);
//virtual void Hide(void);
virtual void Respawn(void);
virtual void Pain(void);
virtual void Death(void);

View File

@ -815,6 +815,7 @@ NSMonster::Death(void)
TriggerTargets();
}
#if 0
void
NSMonster::Hide(void)
{
@ -823,6 +824,7 @@ NSMonster::Hide(void)
SetMovetype(MOVETYPE_NONE);
customphysics = __NULL__;
}
#endif
void
NSMonster::Respawn(void)

View File

@ -139,6 +139,10 @@ public:
virtual void MakeStatic(void);
/* model events */
/** Callback for any model event that gets triggered while playing a framegroup. */
virtual void HandleAnimEvent(float, int,string);
/* set */
/** Sets the bodygroup of the entity. */
nonvirtual void SetBody(int);
@ -181,10 +185,6 @@ public:
/** Returns the value of the entity's bone controller #5. */
nonvirtual float GetBoneControl5(void);
/* model events */
/** Callback for any model event that gets triggered while playing a framegroup. */
virtual void HandleAnimEvent(float, int,string);
#ifdef CLIENT
/** Called by predraw(); and will set the appropriate rendering specific fields. */
nonvirtual void RenderFXPass(void);

View File

@ -109,7 +109,7 @@ public:
virtual void PanicFrame(void);
virtual void OnPlayerUse(void);
virtual void Hide(void);
//virtual void Hide(void);
virtual void Respawn(void);
virtual void SpawnKey(string,string);
virtual float SendEntity(entity,float);

View File

@ -644,12 +644,14 @@ NSTalkMonster::SpawnKey(string strKey, string strValue)
}
}
#if 0
void
NSTalkMonster::Hide(void)
{
m_eFollowing = world;
NSMonster::Hide();
}
#endif
float
NSTalkMonster::SendEntity(entity ePEnt, float flChanged)

View File

@ -77,7 +77,15 @@ public:
/** Called when we stopped touching the last touched entity. */
virtual void EndTouch(entity);
/* override */
virtual void SpawnKey(string,string);
#ifdef SERVER
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Input(entity,string,string);
/** Called whenever we're legacy triggered by another object or function. */
virtual void Trigger(entity,int);
@ -89,7 +97,8 @@ public:
/* master feature */
/** Returns what we will pass onto other's `::GetMaster()` calls if we're their master. */
nonvirtual int GetValue(void);
/* multisource overrides this, so keep virtual */
virtual int GetValue(void);
/** Returns whether our master allows us to be triggered. */
nonvirtual int GetMaster(void);
@ -112,13 +121,7 @@ public:
/** Retrives the team value of a given entity. */
nonvirtual float GetTeam(void);
/* overrides */
virtual void Save(float);
virtual void Restore(string,string);
virtual void Input(entity,string,string);
#endif
virtual void SpawnKey(string,string);
};
enum

View File

@ -41,8 +41,7 @@ public:
virtual string GetObituaryMessage(void);
/** Returns the weapon type. Check weapontype_t for details. */
virtual int GetType(void);
/** Returns the owner/wielder of the weapon. */
virtual entity GetOwner(void);
/** Returns primary attack clip */
virtual int GetClip1(void);
/** Returns secondary attack clip */

View File

@ -117,12 +117,6 @@ NSWeapon::GetType(void)
return 0;
}
entity
NSWeapon::GetOwner(void)
{
return m_owner;
}
int
NSWeapon::GetClip1(void)
{