Ultimately remove the deprecated old class names for base entities.

This commit is contained in:
Marco Cawthorne 2022-05-10 15:01:40 -07:00
parent 77c3cf4e10
commit a039a69dd3
Signed by: eukara
GPG key ID: C196CD8BA993248A
6 changed files with 26 additions and 81 deletions

View file

@ -19,34 +19,3 @@
void FX_Spark(vector, vector); void FX_Spark(vector, vector);
void FX_BreakModel(int, vector, vector, vector, float); void FX_BreakModel(int, vector, vector, vector, float);
/* Backwards compat */
class CBaseMonster:NSMonster
{
void(void) CBaseMonster;
};
void
CBaseMonster::CBaseMonster(void)
{
super::NSMonster();
}
class CBaseNPC:NSTalkMonster
{
void(void) CBaseNPC;
};
void
CBaseNPC::CBaseNPC(void)
{
super::NSTalkMonster();
}
class CBasePhysics:NSPhysicsEntity
{
void(void) CBasePhysics;
};
void
CBasePhysics::CBasePhysics(void)
{
super::NSPhysicsEntity();
}

View file

@ -24,7 +24,8 @@ Dynamic door that will move back down if it's not being used.
This entity was introduced in Half-Life (1998). This entity was introduced in Half-Life (1998).
*/ */
class momentary_door:CBaseMomentary class
momentary_door:NSMomentary
{ {
void(void) momentary_door; void(void) momentary_door;
@ -137,5 +138,5 @@ momentary_door::SpawnKey(string strKey, string strValue)
void void
momentary_door::momentary_door(void) momentary_door::momentary_door(void)
{ {
super::CBaseMomentary(); super::NSMomentary();
} }

View file

@ -47,7 +47,8 @@ enumflags
MRBFL_YAXIS MRBFL_YAXIS
}; };
class momentary_rot_button:CBaseMomentary class
momentary_rot_button:NSMomentary
{ {
int m_iTurnDir; int m_iTurnDir;
@ -155,12 +156,12 @@ momentary_rot_button::OnPlayerUse(void)
m_iTurnDir = 1 - m_iTurnDir; m_iTurnDir = 1 - m_iTurnDir;
for (entity e = world; (e = find(e, ::targetname, target));) { for (entity e = world; (e = find(e, ::targetname, target));) {
CBaseMomentary b = (CBaseMomentary)e; NSMomentary b = (NSMomentary)e;
b.SetMoveState(iEndState); b.SetMoveState(iEndState);
} }
for (entity e = world; (e = find(e, ::targetname, targetname));) { for (entity e = world; (e = find(e, ::targetname, targetname));) {
CBaseMomentary b = (CBaseMomentary)e; NSMomentary b = (NSMomentary)e;
/* door hack: any entity with the same name as ours will follow our states */ /* door hack: any entity with the same name as ours will follow our states */
if (b.HasSpawnFlags(MRBFL_DOORHACK)) if (b.HasSpawnFlags(MRBFL_DOORHACK))
@ -185,12 +186,12 @@ momentary_rot_button::OnPlayerUnUse(void)
SetMoveState(iEndState); SetMoveState(iEndState);
for (entity e = world; (e = find(e, ::targetname, target));) { for (entity e = world; (e = find(e, ::targetname, target));) {
CBaseMomentary b = (CBaseMomentary)e; NSMomentary b = (NSMomentary)e;
b.SetMoveState(iEndState); b.SetMoveState(iEndState);
} }
for (entity e = world; (e = find(e, ::targetname, targetname));) { for (entity e = world; (e = find(e, ::targetname, targetname));) {
CBaseMomentary b = (CBaseMomentary)e; NSMomentary b = (NSMomentary)e;
/* door hack: any entity with the same name as ours will follow our states */ /* door hack: any entity with the same name as ours will follow our states */
if (b.HasSpawnFlags(MRBFL_DOORHACK)) if (b.HasSpawnFlags(MRBFL_DOORHACK))
@ -262,5 +263,5 @@ void
momentary_rot_button::momentary_rot_button(void) momentary_rot_button::momentary_rot_button(void)
{ {
m_flReturnspeed = m_flSpeed = -1; m_flReturnspeed = m_flSpeed = -1;
super::CBaseMomentary(); super::NSMomentary();
} }

View file

@ -21,7 +21,8 @@ typedef enum
MOMENTARY_RETURNING MOMENTARY_RETURNING
}; };
class CBaseMomentary:NSRenderableEntity class
NSMomentary:NSRenderableEntity
{ {
entity m_eUser; entity m_eUser;
vector m_vecMoveDir; vector m_vecMoveDir;
@ -36,7 +37,7 @@ class CBaseMomentary:NSRenderableEntity
float m_flSpeed; float m_flSpeed;
float m_flReturnspeed; float m_flReturnspeed;
void(void) CBaseMomentary; void(void) NSMomentary;
/* overrides */ /* overrides */
virtual void(float) Save; virtual void(float) Save;
@ -48,19 +49,19 @@ class CBaseMomentary:NSRenderableEntity
}; };
float float
CBaseMomentary::GetProgress(void) NSMomentary::GetProgress(void)
{ {
return 0.0f; return 0.0f;
} }
void void
CBaseMomentary::MovementStateChanged(void) NSMomentary::MovementStateChanged(void)
{ {
/* this is handled by the respective sub entity */ /* this is handled by the respective sub entity */
} }
void void
CBaseMomentary::SetMoveState(int status) NSMomentary::SetMoveState(int status)
{ {
if (m_iMoveState == status) if (m_iMoveState == status)
return; return;
@ -70,7 +71,7 @@ CBaseMomentary::SetMoveState(int status)
} }
void void
CBaseMomentary::Save(float handle) NSMomentary::Save(float handle)
{ {
SaveFloat(handle, "user", num_for_edict(m_eUser)); SaveFloat(handle, "user", num_for_edict(m_eUser));
SaveVector(handle, "move_dir", m_vecMoveDir); SaveVector(handle, "move_dir", m_vecMoveDir);
@ -85,7 +86,7 @@ CBaseMomentary::Save(float handle)
} }
void void
CBaseMomentary::Restore(string strKey, string strValue) NSMomentary::Restore(string strKey, string strValue)
{ {
switch (strKey) { switch (strKey) {
case "user": case "user":
@ -118,7 +119,7 @@ CBaseMomentary::Restore(string strKey, string strValue)
} }
void void
CBaseMomentary::CBaseMomentary(void) NSMomentary::NSMomentary(void)
{ {
super::NSRenderableEntity(); super::NSRenderableEntity();
} }

View file

@ -28,38 +28,4 @@
#include "NSMonster.h" #include "NSMonster.h"
#include "NSTalkMonster.h" #include "NSTalkMonster.h"
#include "NSProjectile.h" #include "NSProjectile.h"
/*
============
Compatibility Layer
CBaseEntity was once the main, bloated class.
It's since been replaced by a smaller NSEntity class.
Here we have to make sure that CBaseEntity points to the
largest general purpose entity that is renderable.
============
*/
/* TODO: Throw this out */
class CBaseEntity:NSSurfacePropEntity
{
void(void) CBaseEntity;
};
void
CBaseEntity::CBaseEntity(void)
{
NSSurfacePropEntity::NSSurfacePropEntity();
}
class CBaseTrigger:CBaseEntity
{
void(void) CBaseTrigger;
};
void
CBaseTrigger::CBaseTrigger(void)
{
CBaseEntity::CBaseEntity();
}
#endif #endif

View file

@ -73,6 +73,13 @@
#define printf(x, ...) print(sprintf(x, ...)) #define printf(x, ...) print(sprintf(x, ...))
void
_NSLog(string msg)
{
print(sprintf("%f %s\n", time, msg));
}
#define NSLog(x, ...) _NSLog(sprintf(x, ...))
const vector VEC_HULL_MIN = [-16,-16,-36]; const vector VEC_HULL_MIN = [-16,-16,-36];
const vector VEC_HULL_MAX = [16,16,36]; const vector VEC_HULL_MAX = [16,16,36];
const vector VEC_CHULL_MIN = [-16,-16,-18]; const vector VEC_CHULL_MIN = [-16,-16,-18];