Regamedll API WIP: implemented interfaces some objects.

This commit is contained in:
s1lentq 2016-03-13 19:11:22 +06:00
parent 9fd5eaa043
commit 7b227c0edb
53 changed files with 2302 additions and 32 deletions

View File

@ -32,7 +32,7 @@
#pragma once
#endif
typedef enum
typedef enum Activity_s
{
ACT_INVALID = -1,

View File

@ -13,6 +13,7 @@ TYPEDESCRIPTION CAirtank::m_SaveData[] =
#endif
LINK_ENTITY_TO_CLASS(item_airtank, CAirtank);
LINK_CLASS_TO_WRAP(CAirtank, CCSAirtank);
IMPLEMENT_SAVERESTORE(CAirtank, CGrenade);
void CAirtank::__MAKE_VHOOK(Spawn)()

View File

@ -35,6 +35,7 @@
class CAirtank: public CGrenade
{
public:
CAirtank();
virtual void Spawn();
virtual void Precache();
virtual int Save(CSave &save);

View File

@ -25,6 +25,7 @@ BOOL C9MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_9mm, C9MMAmmo);
LINK_CLASS_TO_WRAP(C9MMAmmo, CCS9MMAmmo);
void CBuckShotAmmo::__MAKE_VHOOK(Spawn)()
{
@ -51,6 +52,7 @@ BOOL CBuckShotAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_buckshot, CBuckShotAmmo);
LINK_CLASS_TO_WRAP(CBuckShotAmmo, CCSBuckShotAmmo);
void C556NatoAmmo::__MAKE_VHOOK(Spawn)()
{
@ -77,6 +79,7 @@ BOOL C556NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_556nato, C556NatoAmmo);
LINK_CLASS_TO_WRAP(C556NatoAmmo, CCS556NatoAmmo);
void C556NatoBoxAmmo::__MAKE_VHOOK(Spawn)()
{
@ -103,6 +106,7 @@ BOOL C556NatoBoxAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_556natobox, C556NatoBoxAmmo);
LINK_CLASS_TO_WRAP(C556NatoBoxAmmo, CCS556NatoBoxAmmo);
void C762NatoAmmo::__MAKE_VHOOK(Spawn)()
{
@ -129,6 +133,7 @@ BOOL C762NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_762nato, C762NatoAmmo);
LINK_CLASS_TO_WRAP(C762NatoAmmo, CCS762NatoAmmo);
void C45ACPAmmo::__MAKE_VHOOK(Spawn)()
{
@ -155,6 +160,7 @@ BOOL C45ACPAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_45acp, C45ACPAmmo);
LINK_CLASS_TO_WRAP(C45ACPAmmo, CCS45ACPAmmo);
void C50AEAmmo::__MAKE_VHOOK(Spawn)()
{
@ -181,6 +187,7 @@ BOOL C50AEAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_50ae, C50AEAmmo);
LINK_CLASS_TO_WRAP(C50AEAmmo, CCS50AEAmmo);
void C338MagnumAmmo::__MAKE_VHOOK(Spawn)()
{
@ -207,6 +214,7 @@ BOOL C338MagnumAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_338magnum, C338MagnumAmmo);
LINK_CLASS_TO_WRAP(C338MagnumAmmo, CCS338MagnumAmmo);
void C57MMAmmo::__MAKE_VHOOK(Spawn)()
{
@ -233,6 +241,7 @@ BOOL C57MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_57mm, C57MMAmmo);
LINK_CLASS_TO_WRAP(C57MMAmmo, CCS57MMAmmo);
void C357SIGAmmo::__MAKE_VHOOK(Spawn)()
{
@ -259,3 +268,4 @@ BOOL C357SIGAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(ammo_357sig, C357SIGAmmo);
LINK_CLASS_TO_WRAP(C357SIGAmmo, CCS357SIGAmmo);

View File

@ -35,6 +35,7 @@
class C9MMAmmo: public CBasePlayerAmmo
{
public:
C9MMAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -52,6 +53,7 @@ public:
class CBuckShotAmmo: public CBasePlayerAmmo
{
public:
CBuckShotAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -69,6 +71,7 @@ public:
class C556NatoAmmo: public CBasePlayerAmmo
{
public:
C556NatoAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -86,6 +89,7 @@ public:
class C556NatoBoxAmmo: public CBasePlayerAmmo
{
public:
C556NatoBoxAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -103,6 +107,7 @@ public:
class C762NatoAmmo: public CBasePlayerAmmo
{
public:
C762NatoAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -120,6 +125,7 @@ public:
class C45ACPAmmo: public CBasePlayerAmmo
{
public:
C45ACPAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -137,6 +143,7 @@ public:
class C50AEAmmo: public CBasePlayerAmmo
{
public:
C50AEAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -154,6 +161,7 @@ public:
class C338MagnumAmmo: public CBasePlayerAmmo
{
public:
C338MagnumAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -171,6 +179,7 @@ public:
class C57MMAmmo: public CBasePlayerAmmo
{
public:
C57MMAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);
@ -187,6 +196,7 @@ public:
class C357SIGAmmo: public CBasePlayerAmmo
{
public:
C357SIGAmmo();
virtual void Spawn();
virtual void Precache();
virtual BOOL AddAmmo(CBaseEntity *pOther);

View File

@ -35,6 +35,7 @@ Vector VecBModelOrigin(entvars_t *pevBModel)
}
LINK_ENTITY_TO_CLASS(func_wall, CFuncWall);
LINK_CLASS_TO_WRAP(CFuncWall, CCSFuncWall);
void CFuncWall::__MAKE_VHOOK(Spawn)()
{
@ -59,6 +60,7 @@ void CFuncWall::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
}
LINK_ENTITY_TO_CLASS(func_wall_toggle, CFuncWallToggle);
LINK_CLASS_TO_WRAP(CFuncWallToggle, CCSFuncWallToggle);
void CFuncWallToggle::__MAKE_VHOOK(Spawn)()
{
@ -108,6 +110,7 @@ void CFuncWallToggle::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pC
}
LINK_ENTITY_TO_CLASS(func_conveyor, CFuncConveyor);
LINK_CLASS_TO_WRAP(CFuncConveyor, CCSFuncConveyor);
void CFuncConveyor::__MAKE_VHOOK(Spawn)()
{
@ -155,6 +158,7 @@ void CFuncConveyor::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCal
}
LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary);
LINK_CLASS_TO_WRAP(CFuncIllusionary, CCSFuncIllusionary);
void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
@ -185,6 +189,7 @@ void CFuncIllusionary::__MAKE_VHOOK(Spawn)()
}
LINK_ENTITY_TO_CLASS(func_monsterclip, CFuncMonsterClip);
LINK_CLASS_TO_WRAP(CFuncMonsterClip, CCSFuncMonsterClip);
void CFuncMonsterClip::__MAKE_VHOOK(Spawn)()
{
@ -199,7 +204,7 @@ void CFuncMonsterClip::__MAKE_VHOOK(Spawn)()
}
LINK_ENTITY_TO_CLASS(func_rotating, CFuncRotating);
LINK_CLASS_TO_WRAP(CFuncRotating, CCSFuncRotating);
IMPLEMENT_SAVERESTORE(CFuncRotating, CBaseEntity);
void CFuncRotating::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
@ -603,6 +608,7 @@ void CFuncRotating::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
}
LINK_ENTITY_TO_CLASS(func_pendulum, CPendulum);
LINK_CLASS_TO_WRAP(CPendulum, CCSPendulum);
IMPLEMENT_SAVERESTORE(CPendulum, CBaseEntity);
void CPendulum::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)

View File

@ -59,6 +59,7 @@
class CFuncWall: public CBaseEntity
{
public:
CFuncWall();
virtual void Spawn();
// Bmodels don't go across transitions
@ -77,6 +78,7 @@ public:
class CFuncWallToggle: public CFuncWall
{
public:
CFuncWallToggle();
virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -96,6 +98,7 @@ public:
class CFuncConveyor: public CFuncWall
{
public:
CFuncConveyor();
virtual void Spawn();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -114,6 +117,7 @@ public:
class CFuncIllusionary: public CBaseToggle
{
public:
CFuncIllusionary();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int ObjectCaps() { return CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION; }
@ -139,6 +143,7 @@ public:
class CFuncMonsterClip: public CFuncWall
{
public:
CFuncMonsterClip();
virtual void Spawn();
// Clear out func_wall's use function
@ -156,6 +161,7 @@ public:
class CFuncRotating: public CBaseEntity
{
public:
CFuncRotating();
// basic functions
virtual void Spawn();
virtual void Precache();
@ -197,6 +203,7 @@ public:
class CPendulum: public CBaseEntity
{
public:
CPendulum();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);

View File

@ -54,6 +54,7 @@ TYPEDESCRIPTION CEnvSpark::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CEnvGlobal, CBaseEntity);
LINK_ENTITY_TO_CLASS(env_global, CEnvGlobal);
LINK_CLASS_TO_WRAP(CEnvGlobal, CCSEnvGlobal);
void CEnvGlobal::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
@ -136,6 +137,7 @@ void CEnvGlobal::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller
IMPLEMENT_SAVERESTORE(CMultiSource, CBaseEntity);
LINK_ENTITY_TO_CLASS(multisource, CMultiSource);
LINK_CLASS_TO_WRAP(CMultiSource, CCSMultiSource);
// Cache user-entity-field values until spawn is called.
void CMultiSource::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
@ -426,6 +428,7 @@ int CBaseButton::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pe
// 2) metallic click
// 3) in-out
LINK_ENTITY_TO_CLASS(func_button, CBaseButton);
LINK_CLASS_TO_WRAP(CBaseButton, CCSButton);
void CBaseButton::__MAKE_VHOOK(Spawn)()
{
@ -790,6 +793,7 @@ void CBaseButton::ButtonBackHome()
}
LINK_ENTITY_TO_CLASS(func_rot_button, CRotButton);
LINK_CLASS_TO_WRAP(CRotButton, CCSRotButton);
void CRotButton::__MAKE_VHOOK(Spawn)()
{
@ -857,6 +861,7 @@ void CRotButton::__MAKE_VHOOK(Spawn)()
IMPLEMENT_SAVERESTORE(CMomentaryRotButton, CBaseToggle);
LINK_ENTITY_TO_CLASS(momentary_rot_button, CMomentaryRotButton);
LINK_CLASS_TO_WRAP(CMomentaryRotButton, CCSMomentaryRotButton);
void CMomentaryRotButton::__MAKE_VHOOK(Spawn)()
{
@ -1073,6 +1078,7 @@ void CMomentaryRotButton::UpdateSelfReturn(float value)
IMPLEMENT_SAVERESTORE(CEnvSpark, CBaseEntity);
LINK_ENTITY_TO_CLASS(env_spark, CEnvSpark);
LINK_ENTITY_TO_CLASS(env_debris, CEnvSpark);
LINK_CLASS_TO_WRAP(CEnvSpark, CCSEnvSpark);
void CEnvSpark::__MAKE_VHOOK(Spawn)()
{
@ -1155,6 +1161,7 @@ void CEnvSpark::SparkStop(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYP
}
LINK_ENTITY_TO_CLASS(button_target, CButtonTarget);
LINK_CLASS_TO_WRAP(CButtonTarget, CCSButtonTarget);
void CButtonTarget::__MAKE_VHOOK(Spawn)()
{

View File

@ -34,8 +34,8 @@
#define SF_BUTTON_DONTMOVE 1
#define SF_ROTBUTTON_NOTSOLID 1
#define SF_BUTTON_TOGGLE 32 // button stays pushed until reactivated
#define SF_BUTTON_SPARK_IF_OFF 64 // button sparks in OFF state
#define SF_BUTTON_TOGGLE 32 // button stays pushed until reactivated
#define SF_BUTTON_SPARK_IF_OFF 64 // button sparks in OFF state
#define SF_BUTTON_TOUCH_ONLY 256 // button only fires as a result of USE key.
#define SF_GLOBAL_SET 1 // Set global state to initial state on spawn
@ -57,6 +57,7 @@
class CEnvGlobal: public CPointEntity
{
public:
CEnvGlobal();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
@ -84,6 +85,7 @@ public:
class CRotButton: public CBaseButton
{
public:
CRotButton();
virtual void Spawn();
#ifdef HOOK_GAMEDLL
@ -96,6 +98,7 @@ public:
class CMomentaryRotButton: public CBaseToggle
{
public:
CMomentaryRotButton();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
@ -147,6 +150,7 @@ public:
class CEnvSpark: public CBaseEntity
{
public:
CEnvSpark();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -170,13 +174,13 @@ public:
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
float m_flDelay;
};
class CButtonTarget: public CBaseEntity
{
public:
CButtonTarget();
virtual void Spawn();
virtual int ObjectCaps();
virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType);

View File

@ -62,6 +62,8 @@ static DLL_FUNCTIONS gFunctionTable =
static NEW_DLL_FUNCTIONS gNewDLLFunctions
{
&OnFreeEntPrivateData,
&GameDLLShutdown,
NULL,
NULL,
NULL
};
@ -81,6 +83,8 @@ BOOL gTouchDisabled = FALSE;
#endif // HOOK_GAMEDLL
const std::type_info *g_typeInfo = NULL;
int CaseInsensitiveHash(const char *string, int iBounds)
{
unsigned int hash = 0;
@ -1080,4 +1084,7 @@ void OnFreeEntPrivateData(edict_t *pEnt)
pEntity->UpdateOnRemove();
RemoveEntityHashValue(pEntity->pev, STRING(pEntity->pev->classname), CLASSNAME);
Regamedll_FreeEntities(pEntity);
}
//LINK_CLASS_TO_WRAP(CBaseEntity, CCSEntity);

View File

@ -358,7 +358,12 @@ public:
#endif
public:
void *operator new(size_t stAllocateBlock, entvars_t *pevnew) { return ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock); }
void *operator new(size_t stAllocateBlock, entvars_t *pevnew)
{
CBaseEntity *ent = (CBaseEntity *)ALLOC_PRIVATE(ENT(pevnew), stAllocateBlock);
ent->pev = pevnew;
return ent;
}
void operator delete(void *pMem, entvars_t *pevnew) { pevnew->flags |= FL_KILLME; }
void UpdateOnRemove();
void EXPORT SUB_Remove();
@ -448,6 +453,7 @@ inline int FNullEnt(EHANDLE hent) { return (hent == NULL || FNullEnt(OFFSET(hent
class CPointEntity: public CBaseEntity
{
public:
CPointEntity();
virtual void Spawn();
virtual int ObjectCaps() { return (CBaseEntity::ObjectCaps() & ~FCAP_ACROSS_TRANSITION); }
@ -462,22 +468,23 @@ public:
class CMultiSource: public CPointEntity
{
public:
CMultiSource();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
virtual int ObjectCaps() { return (CPointEntity::ObjectCaps() | FCAP_MASTER); }
virtual BOOL IsTriggered(CBaseEntity *pActivator);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
virtual int ObjectCaps() { return (CPointEntity::ObjectCaps() | FCAP_MASTER); }
virtual BOOL IsTriggered(CBaseEntity *pActivator);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#ifdef HOOK_GAMEDLL
void Spawn_();
void KeyValue_(KeyValueData *pkvd);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
BOOL IsTriggered_(CBaseEntity *pActivator);
int Save_(CSave &save);
int Restore_(CRestore &restore);
BOOL IsTriggered_(CBaseEntity *pActivator);
void Use_(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
#endif
@ -496,6 +503,7 @@ public:
class CBaseDelay: public CBaseEntity
{
public:
CBaseDelay();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -628,7 +636,7 @@ class CBaseButton: public CBaseToggle
BUTTON_RETURN
};
public:
CBaseButton();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -688,6 +696,7 @@ public:
class CWorld: public CBaseEntity
{
public:
CWorld();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -702,6 +711,25 @@ public:
};
extern const std::type_info *g_typeInfo;
extern class CCSEntity **g_GameEntities;
template <class T>
T *GetClassPtrWrap(CBaseEntity *a)
{
// yet not allocated?
if (g_GameEntities == NULL)
return NULL;
// to ignore constructor classes invoked by inheritance
if (!g_typeInfo || g_typeInfo != &typeid(*a))
return NULL;
int index = a->entindex();
g_GameEntities[index] = new T (a);
return reinterpret_cast<T *>(g_GameEntities[index]);
}
template <class T>
T *GetClassPtr(T *a)
{
@ -711,8 +739,9 @@ T *GetClassPtr(T *a)
a = (T *)GET_PRIVATE(ENT(pev));
if (!a)
{
g_typeInfo = &typeid(T);
a = new(pev) T;
a->pev = pev;
g_typeInfo = NULL;
#if defined(HOOK_GAMEDLL) && defined(_WIN32) && !defined(REGAMEDLL_UNIT_TESTS)
VirtualTableInit((void *)a, stripClass(typeid(T).name()));

View File

@ -142,6 +142,7 @@ BOOL EXT_FUNC ClientConnect(edict_t *pEntity, const char *pszName, const char *p
void EXT_FUNC ClientDisconnect(edict_t *pEntity)
{
CBasePlayer *pPlayer = dynamic_cast<CBasePlayer *>(CBaseEntity::Instance(pEntity));
CSPlayer(pPlayer)->OnClientDisconnected();
if (!g_fGameOver)
{
@ -476,6 +477,7 @@ void EXT_FUNC ClientPutInServer(edict_t *pEntity)
pPlayer->SetCustomDecalFrames(-1);
pPlayer->SetPrefsFromUserinfo(GET_INFO_BUFFER(pEntity));
CSPlayer(pPlayer)->OnClientConnected();
if (!g_pGameRules->IsMultiplayer())
{

View File

@ -191,6 +191,7 @@ LINK_ENTITY_TO_CLASS(func_door, CBaseDoor);
// func_water - same as a door.
LINK_ENTITY_TO_CLASS(func_water, CBaseDoor);
LINK_CLASS_TO_WRAP(CBaseDoor, CCSDoor);
void CBaseDoor::__MAKE_VHOOK(Spawn)()
{
@ -841,6 +842,7 @@ void CBaseDoor::__MAKE_VHOOK(Blocked)(CBaseEntity *pOther)
// 3) stone chain
// 4) screechy metal
LINK_ENTITY_TO_CLASS(func_door_rotating, CRotDoor);
LINK_CLASS_TO_WRAP(CRotDoor, CCSRotDoor);
void CRotDoor::__MAKE_VHOOK(Restart)()
{
@ -939,6 +941,7 @@ void CRotDoor::__MAKE_VHOOK(SetToggleState)(int state)
}
LINK_ENTITY_TO_CLASS(momentary_door, CMomentaryDoor);
LINK_CLASS_TO_WRAP(CMomentaryDoor, CCSMomentaryDoor);
IMPLEMENT_SAVERESTORE(CMomentaryDoor, CBaseToggle);
void CMomentaryDoor::__MAKE_VHOOK(Spawn)()

View File

@ -51,6 +51,7 @@
class CBaseDoor: public CBaseToggle
{
public:
CBaseDoor();
virtual void Spawn();
virtual void Precache();
virtual void Restart();
@ -112,6 +113,7 @@ public:
class CRotDoor: public CBaseDoor
{
public:
CRotDoor();
virtual void Spawn();
virtual void Restart();
virtual void SetToggleState(int state);
@ -129,6 +131,7 @@ public:
class CMomentaryDoor: public CBaseToggle
{
public:
CMomentaryDoor();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);

View File

@ -62,7 +62,11 @@ TYPEDESCRIPTION CGibShooter::m_SaveData[] =
#endif // HOOK_GAMEDLL
LINK_ENTITY_TO_CLASS(info_target, CPointEntity);
LINK_CLASS_TO_WRAP(CPointEntity, CCSPointEntity);
LINK_ENTITY_TO_CLASS(env_bubbles, CBubbling);
LINK_CLASS_TO_WRAP(CBubbling, CCSBubbling);
IMPLEMENT_SAVERESTORE(CBubbling, CBaseEntity);
void CBubbling::__MAKE_VHOOK(Spawn)()
@ -155,6 +159,7 @@ void CBubbling::FizzThink()
}
LINK_ENTITY_TO_CLASS(beam, CBeam);
LINK_CLASS_TO_WRAP(CBeam, CCSBeam);
void CBeam::__MAKE_VHOOK(Spawn)()
{
@ -352,6 +357,8 @@ void CBeam::DoSparks(const Vector &start, const Vector &end)
LINK_ENTITY_TO_CLASS(env_lightning, CLightning);
LINK_ENTITY_TO_CLASS(env_beam, CLightning);
LINK_CLASS_TO_WRAP(CLightning, CCSLightning);
IMPLEMENT_SAVERESTORE(CLightning, CBeam);
void CLightning::__MAKE_VHOOK(Spawn)()
@ -847,6 +854,7 @@ void CLightning::BeamUpdateVars()
}
LINK_ENTITY_TO_CLASS(env_laser, CLaser);
LINK_CLASS_TO_WRAP(CLaser, CCSLaser);
IMPLEMENT_SAVERESTORE(CLaser, CBeam);
void CLaser::__MAKE_VHOOK(Spawn)()
@ -1006,6 +1014,7 @@ void CLaser::StrikeThink()
}
LINK_ENTITY_TO_CLASS(env_glow, CGlow);
LINK_CLASS_TO_WRAP(CGlow, CCSGlow);
IMPLEMENT_SAVERESTORE(CGlow, CPointEntity);
void CGlow::__MAKE_VHOOK(Spawn)()
@ -1045,6 +1054,7 @@ void CGlow::Animate(float frames)
}
LINK_ENTITY_TO_CLASS(env_bombglow, CBombGlow);
LINK_CLASS_TO_WRAP(CBombGlow, CCSBombGlow);
void CBombGlow::__MAKE_VHOOK(Spawn)()
{
@ -1097,6 +1107,7 @@ void CBombGlow::__MAKE_VHOOK(Think)()
}
LINK_ENTITY_TO_CLASS(env_sprite, CSprite);
LINK_CLASS_TO_WRAP(CSprite, CCSSprite);
IMPLEMENT_SAVERESTORE(CSprite, CPointEntity);
void CSprite::__MAKE_VHOOK(Spawn)()
@ -1274,6 +1285,7 @@ void CSprite::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, U
IMPLEMENT_SAVERESTORE(CGibShooter, CBaseDelay);
LINK_ENTITY_TO_CLASS(gibshooter, CGibShooter);
LINK_CLASS_TO_WRAP(CGibShooter, CCSGibShooter);
void CGibShooter::__MAKE_VHOOK(Precache)()
{
@ -1426,6 +1438,7 @@ void CGibShooter::ShootThink()
}
LINK_ENTITY_TO_CLASS(env_shooter, CEnvShooter);
LINK_CLASS_TO_WRAP(CEnvShooter, CCSEnvShooter);
void CEnvShooter::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
@ -1498,6 +1511,7 @@ CGib *CEnvShooter::__MAKE_VHOOK(CreateGib)()
}
LINK_ENTITY_TO_CLASS(test_effect, CTestEffect);
LINK_CLASS_TO_WRAP(CTestEffect, CCSTestEffect);
void CTestEffect::__MAKE_VHOOK(Spawn)()
{
@ -1572,6 +1586,7 @@ void CTestEffect::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCalle
}
LINK_ENTITY_TO_CLASS(env_blood, CBlood);
LINK_CLASS_TO_WRAP(CBlood, CCSBlood);
void CBlood::__MAKE_VHOOK(Spawn)()
{
@ -1660,6 +1675,7 @@ void CBlood::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
}
LINK_ENTITY_TO_CLASS(env_shake, CShake);
LINK_CLASS_TO_WRAP(CShake, CCSShake);
void CShake::__MAKE_VHOOK(Spawn)()
{
@ -1704,6 +1720,7 @@ void CShake::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, US
}
LINK_ENTITY_TO_CLASS(env_fade, CFade);
LINK_CLASS_TO_WRAP(CFade, CCSFade);
void CFade::__MAKE_VHOOK(Spawn)()
{
@ -1753,6 +1770,7 @@ void CFade::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE
}
LINK_ENTITY_TO_CLASS(env_message, CMessage);
LINK_CLASS_TO_WRAP(CMessage, CCSMessage);
void CMessage::__MAKE_VHOOK(Spawn)()
{
@ -1846,6 +1864,7 @@ void CMessage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller,
}
LINK_ENTITY_TO_CLASS(env_funnel, CEnvFunnel);
LINK_CLASS_TO_WRAP(CEnvFunnel, CCSEnvFunnel);
void CEnvFunnel::__MAKE_VHOOK(Precache)()
{
@ -1892,6 +1911,7 @@ void CEnvBeverage::__MAKE_VHOOK(Precache)()
}
LINK_ENTITY_TO_CLASS(env_beverage, CEnvBeverage);
LINK_CLASS_TO_WRAP(CEnvBeverage, CCSEnvBeverage);
void CEnvBeverage::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)
{
@ -1934,6 +1954,7 @@ void CItemSoda::__MAKE_VHOOK(Precache)()
}
LINK_ENTITY_TO_CLASS(item_sodacan, CItemSoda);
LINK_CLASS_TO_WRAP(CItemSoda, CCSItemSoda);
void CItemSoda::__MAKE_VHOOK(Spawn)()
{

View File

@ -71,6 +71,7 @@
class CSprite: public CPointEntity
{
public:
CSprite();
virtual void Spawn();
virtual void Precache();
virtual void Restart();
@ -156,6 +157,7 @@ private:
class CBeam: public CBaseEntity
{
public:
CBeam();
virtual void Spawn();
virtual void Precache();
virtual int ObjectCaps()
@ -238,6 +240,7 @@ public:
class CLaser: public CBeam
{
public:
CLaser();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -275,6 +278,7 @@ public:
class CBubbling: public CBaseEntity
{
public:
CBubbling();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -309,6 +313,7 @@ public:
class CLightning: public CBeam
{
public:
CLightning();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -366,6 +371,7 @@ public:
class CGlow: public CPointEntity
{
public:
CGlow();
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -392,6 +398,7 @@ public:
class CBombGlow: public CSprite
{
public:
CBombGlow();
virtual void Spawn();
virtual void Think();
@ -411,6 +418,7 @@ public:
class CGibShooter: public CBaseDelay
{
public:
CGibShooter();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -450,6 +458,7 @@ public:
class CEnvShooter: public CGibShooter
{
public:
CEnvShooter();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
virtual CGib *CreateGib();
@ -469,6 +478,7 @@ public:
class CTestEffect: public CBaseDelay
{
public:
CTestEffect();
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -497,6 +507,7 @@ public:
class CBlood: public CPointEntity
{
public:
CBlood();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -524,6 +535,7 @@ public:
class CShake: public CPointEntity
{
public:
CShake();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -551,6 +563,7 @@ public:
class CFade: public CPointEntity
{
public:
CFade();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -574,6 +587,7 @@ public:
class CMessage: public CPointEntity
{
public:
CMessage();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -593,6 +607,7 @@ public:
class CEnvFunnel: public CBaseDelay
{
public:
CEnvFunnel();
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -612,6 +627,7 @@ public:
class CEnvBeverage: public CBaseDelay
{
public:
CEnvBeverage();
virtual void Spawn();
virtual void Precache();
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value);
@ -629,6 +645,7 @@ public:
class CItemSoda: public CBaseEntity
{
public:
CItemSoda();
virtual void Spawn();
virtual void Precache();

View File

@ -175,7 +175,7 @@ inline void *GET_PRIVATE(edict_t *pent)
#define DELTA_FINDFIELD (*g_engfuncs.pfnDeltaFindField)
#define DELTA_SETBYINDEX (*g_engfuncs.pfnDeltaSetFieldByIndex)
#define DELTA_UNSETBYINDEX (*g_engfuncs.pfnDeltaUnsetFieldByIndex)
#define REMOVE_KEY_VALUE (*g_engfuncs.pfnInfo_RemoveKey)
#define REMOVE_KEY_VALUE (*g_engfuncs.pfnInfo_RemoveKey)
#define SET_PHYSICS_KEY_VALUE (*g_engfuncs.pfnSetPhysicsKeyValue)
#define ENGINE_GETPHYSINFO (*g_engfuncs.pfnGetPhysicsInfoString)
#define ENGINE_SETGROUPMASK (*g_engfuncs.pfnSetGroupMask)

View File

@ -14,6 +14,7 @@ TYPEDESCRIPTION CEnvExplosion::m_SaveData[] =
#endif
LINK_ENTITY_TO_CLASS(spark_shower, CShower);
LINK_CLASS_TO_WRAP(CShower, CCSShower);
void CShower::__MAKE_VHOOK(Spawn)()
{
@ -69,6 +70,7 @@ void CShower::__MAKE_VHOOK(Touch)(CBaseEntity *pOther)
IMPLEMENT_SAVERESTORE(CEnvExplosion, CBaseMonster);
LINK_ENTITY_TO_CLASS(env_explosion, CEnvExplosion);
LINK_CLASS_TO_WRAP(CEnvExplosion, CCSEnvExplosion);
void CEnvExplosion::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{

View File

@ -42,6 +42,7 @@
class CShower: public CBaseEntity
{
public:
CShower();
virtual void Spawn();
virtual int ObjectCaps() { return FCAP_DONT_SAVE; }
virtual void Think();
@ -60,6 +61,7 @@ public:
class CEnvExplosion: public CBaseMonster
{
public:
CEnvExplosion();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);

View File

@ -170,6 +170,7 @@ void CBreakable::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
}
LINK_ENTITY_TO_CLASS(func_breakable, CBreakable);
LINK_CLASS_TO_WRAP(CBreakable, CCSBreakable);
IMPLEMENT_SAVERESTORE(CBreakable, CBaseEntity);
void CBreakable::__MAKE_VHOOK(Spawn)()
@ -849,6 +850,7 @@ int CBreakable::__MAKE_VHOOK(DamageDecal)(int bitsDamageType)
}
LINK_ENTITY_TO_CLASS(func_pushable, CPushable);
LINK_CLASS_TO_WRAP(CPushable, CCSPushable);
IMPLEMENT_SAVERESTORE(CPushable, CBreakable);
void CPushable::__MAKE_VHOOK(Spawn)()

View File

@ -37,7 +37,7 @@
// func breakable
#define SF_BREAK_TRIGGER_ONLY 1 // may only be broken by trigger
#define SF_BREAK_TOUCH 2 // can be 'crashed through' by running player (plate glass)
#define SF_BREAK_TOUCH 2 // can be 'crashed through' by running player (plate glass)
#define SF_BREAK_PRESSURE 4 // can be broken by a player standing on it
#define SF_BREAK_CROWBAR 256 // instant break if hit with crowbar
@ -70,6 +70,7 @@ typedef enum
class CBreakable: public CBaseDelay
{
public:
CBreakable();
// basic functions
virtual void Spawn();
virtual void Precache();
@ -143,6 +144,7 @@ public:
class CPushable: public CBreakable
{
public:
CPushable();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);

View File

@ -60,6 +60,7 @@ Vector gTankSpread[] =
const int MAX_FIRING_SPREADS = ARRAYSIZE(gTankSpread);
IMPLEMENT_SAVERESTORE(CFuncTank, CBaseEntity);
LINK_CLASS_TO_WRAP(CFuncTank, CCSFuncTank);
void CFuncTank::__MAKE_VHOOK(Spawn)()
{
@ -655,6 +656,7 @@ void CFuncTank::StopRotSound()
}
LINK_ENTITY_TO_CLASS(func_tank, CFuncTankGun);
LINK_CLASS_TO_WRAP(CFuncTankGun, CCSFuncTankGun);
void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker)
{
@ -694,6 +696,7 @@ void CFuncTankGun::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &for
}
LINK_ENTITY_TO_CLASS(func_tanklaser, CFuncTankLaser);
LINK_CLASS_TO_WRAP(CFuncTankLaser, CCSFuncTankLaser);
IMPLEMENT_SAVERESTORE(CFuncTankLaser, CFuncTank);
void CFuncTankLaser::__MAKE_VHOOK(Activate)()
@ -790,6 +793,7 @@ void CFuncTankLaser::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &f
}
LINK_ENTITY_TO_CLASS(func_tankrocket, CFuncTankRocket);
LINK_CLASS_TO_WRAP(CFuncTankRocket, CCSFuncTankRocket);
void CFuncTankRocket::__MAKE_VHOOK(Precache)()
{
@ -820,6 +824,7 @@ void CFuncTankRocket::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &
}
LINK_ENTITY_TO_CLASS(func_tankmortar, CFuncTankMortar);
LINK_CLASS_TO_WRAP(CFuncTankMortar, CCSFuncTankMortar);
void CFuncTankMortar::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
@ -858,6 +863,7 @@ void CFuncTankMortar::__MAKE_VHOOK(Fire)(const Vector &barrelEnd, const Vector &
}
LINK_ENTITY_TO_CLASS(func_tankcontrols, CFuncTankControls);
LINK_CLASS_TO_WRAP(CFuncTankControls, CCSFuncTankControls);
IMPLEMENT_SAVERESTORE(CFuncTankControls, CBaseEntity);
void CFuncTankControls::__MAKE_VHOOK(Use)(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value)

View File

@ -51,6 +51,7 @@ enum TANKBULLET
class CFuncTank: public CBaseEntity
{
public:
CFuncTank();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);
@ -159,12 +160,11 @@ protected:
class CFuncTankGun: public CFuncTank
{
public:
CFuncTankGun();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#ifdef HOOK_GAMEDLL
void Fire_(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
#endif
};
@ -172,6 +172,7 @@ public:
class CFuncTankLaser: public CFuncTank
{
public:
CFuncTankLaser();
virtual void KeyValue(KeyValueData *pkvd);
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -203,6 +204,7 @@ private:
class CFuncTankRocket: public CFuncTank
{
public:
CFuncTankRocket();
virtual void Precache();
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
@ -218,6 +220,7 @@ public:
class CFuncTankMortar: public CFuncTank
{
public:
CFuncTankMortar();
virtual void KeyValue(KeyValueData *pkvd);
virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker);
@ -233,6 +236,7 @@ public:
class CFuncTankControls: public CBaseEntity
{
public:
CFuncTankControls();
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -252,7 +256,6 @@ public:
public:
static TYPEDESCRIPTION IMPL(m_SaveData)[1];
CFuncTank *m_pTank;
};

View File

@ -233,3 +233,8 @@ void EXT_FUNC GameDLLInit()
Tutor_RegisterCVars();
Hostage_RegisterCVars();
}
void EXT_FUNC GameDLLShutdown()
{
Regamedll_FreeEntities();
}

View File

@ -139,5 +139,6 @@ extern cvar_t round_infinite;
#endif
void GameDLLInit();
void GameDLLShutdown();
#endif // GAME_H

View File

@ -64,7 +64,7 @@
#define MAX_MOTD_LENGTH 1536 // (MAX_MOTD_CHUNK * 4)
// custom enum
#define WINNER_NONE 0
#define WINNER_NONE 0
#define WINNER_DRAW 1
enum

View File

@ -27,6 +27,7 @@ TYPEDESCRIPTION CGrenade::m_SaveData[] =
#endif
LINK_ENTITY_TO_CLASS(grenade, CGrenade);
LINK_CLASS_TO_WRAP(CGrenade, CCSGrenade);
void CGrenade::Explode(Vector vecSrc, Vector vecAim)
{

View File

@ -18,6 +18,7 @@ TYPEDESCRIPTION CRecharge::m_SaveData[] =
IMPLEMENT_SAVERESTORE(CRecharge, CBaseEntity);
LINK_ENTITY_TO_CLASS(func_recharge, CRecharge);
LINK_CLASS_TO_WRAP(CRecharge, CCSRecharge);
void CRecharge::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{

View File

@ -35,6 +35,7 @@
class CRecharge: public CBaseToggle
{
public:
CRecharge();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);

View File

@ -25,6 +25,7 @@ TYPEDESCRIPTION CWreckage::m_SaveData[] =
#endif
IMPLEMENT_SAVERESTORE(CCycler, CBaseToggle);
LINK_CLASS_TO_WRAP(CCycler, CCSCycler);
void CGenericCycler::__MAKE_VHOOK(Spawn)()
{
@ -32,7 +33,10 @@ void CGenericCycler::__MAKE_VHOOK(Spawn)()
}
LINK_ENTITY_TO_CLASS(cycler, CGenericCycler);
LINK_CLASS_TO_WRAP(CGenericCycler, CCSGenericCycler);
LINK_ENTITY_TO_CLASS(cycler_prdroid, CCyclerProbe);
LINK_CLASS_TO_WRAP(CCyclerProbe, CCSCyclerProbe);
void CCyclerProbe::__MAKE_VHOOK(Spawn)()
{
@ -162,6 +166,7 @@ int CCycler::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAtt
}
LINK_ENTITY_TO_CLASS(cycler_sprite, CCyclerSprite);
LINK_CLASS_TO_WRAP(CCyclerSprite, CCSCyclerSprite);
IMPLEMENT_SAVERESTORE(CCyclerSprite, CBaseEntity);
void CCyclerSprite::__MAKE_VHOOK(Spawn)()
@ -243,6 +248,7 @@ void CCyclerSprite::Animate(float frames)
}
LINK_ENTITY_TO_CLASS(cycler_weapon, CWeaponCycler);
LINK_CLASS_TO_WRAP(CWeaponCycler, CCSWeaponCycler);
void CWeaponCycler::__MAKE_VHOOK(Spawn)()
{
@ -304,6 +310,7 @@ void CWeaponCycler::__MAKE_VHOOK(SecondaryAttack)()
IMPLEMENT_SAVERESTORE(CWreckage, CBaseToggle);
LINK_ENTITY_TO_CLASS(cycler_wreckage, CWreckage);
LINK_CLASS_TO_WRAP(CWreckage, CCSWreckage);
void CWreckage::__MAKE_VHOOK(Spawn)()
{

View File

@ -35,6 +35,7 @@
class CCycler: public CBaseMonster
{
public:
CCycler();
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -70,6 +71,7 @@ public:
class CGenericCycler: public CCycler
{
public:
CGenericCycler();
virtual void Spawn();
#ifdef HOOK_GAMEDLL
@ -84,6 +86,7 @@ public:
class CCyclerProbe: public CCycler
{
public:
CCyclerProbe();
virtual void Spawn();
#ifdef HOOK_GAMEDLL
@ -97,6 +100,7 @@ public:
class CCyclerSprite: public CBaseEntity
{
public:
CCyclerSprite();
virtual void Spawn();
virtual void Restart();
virtual int Save(CSave &save);
@ -137,6 +141,7 @@ public:
class CWeaponCycler: public CBasePlayerWeapon
{
public:
CWeaponCycler();
virtual void Spawn();
virtual int GetItemInfo(ItemInfo *p) { return 0; }
virtual BOOL Deploy();
@ -164,6 +169,7 @@ public:
class CWreckage: public CBaseMonster
{
public:
CWreckage();
virtual void Spawn();
virtual void Precache();
virtual int Save(CSave &save);

View File

@ -17,6 +17,7 @@ TYPEDESCRIPTION CWallHealth::m_SaveData[] =
#endif
LINK_ENTITY_TO_CLASS(item_healthkit, CHealthKit);
LINK_CLASS_TO_WRAP(CHealthKit, CCSHealthKit);
void CHealthKit::__MAKE_VHOOK(Spawn)()
{

View File

@ -35,6 +35,7 @@
class CHealthKit: public CItem
{
public:
CHealthKit();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);

View File

@ -1,6 +1,7 @@
#include "precompiled.h"
LINK_ENTITY_TO_CLASS(world_items, CWorldItem);
LINK_CLASS_TO_WRAP(CWorldItem, CCSWorldItem);
void CWorldItem::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{
@ -45,6 +46,8 @@ void CWorldItem::__MAKE_VHOOK(Spawn)()
REMOVE_ENTITY(edict());
}
LINK_CLASS_TO_WRAP(CItem, CCSItem);
void CItem::__MAKE_VHOOK(Spawn)()
{
pev->movetype = MOVETYPE_TOSS;
@ -143,6 +146,7 @@ BOOL CItemSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_suit, CItemSuit);
LINK_CLASS_TO_WRAP(CItemSuit, CCSItemSuit);
void CItemBattery::__MAKE_VHOOK(Spawn)()
{
@ -190,6 +194,7 @@ BOOL CItemBattery::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_battery, CItemBattery);
LINK_CLASS_TO_WRAP(CItemBattery, CCSItemBattery);
void CItemAntidote::__MAKE_VHOOK(Spawn)()
{
@ -212,6 +217,7 @@ BOOL CItemAntidote::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_antidote, CItemAntidote);
LINK_CLASS_TO_WRAP(CItemAntidote, CCSItemAntidote);
void CItemSecurity::__MAKE_VHOOK(Spawn)()
{
@ -232,6 +238,7 @@ BOOL CItemSecurity::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_security, CItemSecurity);
LINK_CLASS_TO_WRAP(CItemSecurity, CCSItemSecurity);
void CItemLongJump::__MAKE_VHOOK(Spawn)()
{
@ -269,6 +276,7 @@ BOOL CItemLongJump::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_longjump, CItemLongJump);
LINK_CLASS_TO_WRAP(CItemLongJump, CCSItemLongJump);
void CItemKevlar::__MAKE_VHOOK(Spawn)()
{
@ -307,6 +315,7 @@ BOOL CItemKevlar::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_kevlar, CItemKevlar);
LINK_CLASS_TO_WRAP(CItemKevlar, CCSItemKevlar);
void CItemAssaultSuit::__MAKE_VHOOK(Spawn)()
{
@ -344,6 +353,7 @@ BOOL CItemAssaultSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_assaultsuit, CItemAssaultSuit);
LINK_CLASS_TO_WRAP(CItemAssaultSuit, CCSItemAssaultSuit);
void CItemThighPack::__MAKE_VHOOK(Spawn)()
{
@ -387,3 +397,4 @@ BOOL CItemThighPack::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
}
LINK_ENTITY_TO_CLASS(item_thighpack, CItemThighPack);
LINK_CLASS_TO_WRAP(CItemThighPack, CCSItemThighPack);

View File

@ -42,6 +42,7 @@
class CItem: public CBaseEntity
{
public:
CItem();
virtual void Spawn();
virtual CBaseEntity *Respawn();
virtual BOOL MyTouch(CBasePlayer *pPlayer) { return FALSE; }
@ -61,6 +62,7 @@ public:
class CWorldItem: public CBaseEntity
{
public:
CWorldItem();
virtual void Spawn();
virtual void KeyValue(KeyValueData *pkvd);
@ -78,6 +80,7 @@ public:
class CItemSuit: public CItem
{
public:
CItemSuit();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -95,6 +98,7 @@ public:
class CItemBattery: public CItem
{
public:
CItemBattery();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -112,6 +116,7 @@ public:
class CItemAntidote: public CItem
{
public:
CItemAntidote();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -129,6 +134,7 @@ public:
class CItemSecurity: public CItem
{
public:
CItemSecurity();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -146,6 +152,7 @@ public:
class CItemLongJump: public CItem
{
public:
CItemLongJump();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -163,6 +170,7 @@ public:
class CItemKevlar: public CItem
{
public:
CItemKevlar();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -180,6 +188,7 @@ public:
class CItemAssaultSuit: public CItem
{
public:
CItemAssaultSuit();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);
@ -197,6 +206,7 @@ public:
class CItemThighPack: public CItem
{
public:
CItemThighPack();
virtual void Spawn();
virtual void Precache();
virtual BOOL MyTouch(CBasePlayer *pPlayer);

View File

@ -32,7 +32,7 @@
#pragma once
#endif
typedef struct
typedef struct MonsterEvent_s
{
int event;
char *options;

View File

@ -324,6 +324,7 @@ void WriteSigonMessages()
}
LINK_ENTITY_TO_CLASS(player, CBasePlayer);
LINK_CLASS_TO_WRAP(CBasePlayer, CCSPlayer);
void SendItemStatus(CBasePlayer *pPlayer)
{

View File

@ -352,6 +352,7 @@ public:
class CBasePlayer: public CBaseMonster
{
public:
CBasePlayer();
virtual void Spawn();
virtual void Precache();
virtual int Save(CSave &save);

View File

@ -50,7 +50,7 @@
#define SPEAKER_START_SILENT 1 // wait for trigger 'on' to start announcements
#define LFO_SQUARE 1 // square
#define LFO_SQUARE 1 // square
#define LFO_TRIANGLE 2 // triangle
#define LFO_RANDOM 3 // random

View File

@ -181,6 +181,7 @@ void FireTargets(const char *targetName, CBaseEntity *pActivator, CBaseEntity *p
}
LINK_ENTITY_TO_CLASS(DelayedUse, CBaseDelay);
LINK_CLASS_TO_WRAP(CBaseDelay, CCSDelay);
void CBaseDelay::SUB_UseTargets(CBaseEntity *pActivator, USE_TYPE useType, float value)
{

View File

@ -39,14 +39,14 @@
#define MAX_ENTITY 512 // We can only ever move 512 entities across a transition
// triggers
#define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2 // players not allowed to fire this trigger
#define SF_TRIGGER_ALLOWMONSTERS 1 // monsters allowed to fire this trigger
#define SF_TRIGGER_NOCLIENTS 2 // players not allowed to fire this trigger
#define SF_TRIGGER_PUSHABLES 4 // only pushables can fire this trigger
#define SF_TRIGGER_PUSH_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_PUSH_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_TARGETONCE 1 // Only fire hurt target once
#define SF_TRIGGER_HURT_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_NO_CLIENTS 8 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_START_OFF 2 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_NO_CLIENTS 8 // spawnflag that makes trigger_push spawn turned OFF
#define SF_TRIGGER_HURT_CLIENTONLYFIRE 16 // trigger hurt will only fire its target if it is hurting a client
#define SF_TRIGGER_HURT_CLIENTONLYTOUCH 32 // only clients may touch this trigger.

View File

@ -123,7 +123,7 @@ extern globalvars_t *gpGlobals;
#define SF_BRUSH_ROTATE_Z_AXIS 4
#define SF_BRUSH_ROTATE_X_AXIS 8
#define SF_PENDULUM_AUTO_RETURN 16
#define SF_PENDULUM_PASSABLE 32
#define SF_PENDULUM_PASSABLE 32
#define SF_BRUSH_ROTATE_SMALLRADIUS 128
#define SF_BRUSH_ROTATE_MEDIUMRADIUS 256
@ -158,13 +158,21 @@ extern globalvars_t *gpGlobals;
#endif
#define REGAMEDLL_ALLOC_FUNC
#define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName)\
C_DLLEXPORT void EXT_FUNC mapClassName(entvars_t *pev);\
void mapClassName(entvars_t *pev)\
{\
REGAMEDLL_ALLOC_FUNC\
GetClassPtr((DLLClassName *)pev);\
}
#define LINK_CLASS_TO_WRAP(className, classNameWrap)\
className::className()\
{\
GetClassPtrWrap<classNameWrap>(this);\
}\
typedef enum
{
ignore_monsters = 1,

View File

@ -1530,6 +1530,7 @@ float CBasePlayerWeapon::GetNextAttackDelay(float delay)
}
LINK_ENTITY_TO_CLASS(weaponbox, CWeaponBox);
LINK_CLASS_TO_WRAP(CWeaponBox, CCSWeaponBox);
IMPLEMENT_SAVERESTORE(CWeaponBox, CBaseEntity);
void CWeaponBox::__MAKE_VHOOK(Precache)()

View File

@ -155,6 +155,7 @@ public:
class CGrenade: public CBaseMonster
{
public:
CGrenade();
virtual void Spawn();
virtual int Save(CSave &save);
virtual int Restore(CRestore &restore);
@ -457,6 +458,7 @@ public:
class CWeaponBox: public CBaseEntity
{
public:
CWeaponBox();
virtual void Spawn();
virtual void Precache();
virtual void KeyValue(KeyValueData *pkvd);

View File

@ -410,7 +410,13 @@ void EXT_FUNC ResetGlobalState()
gInitHUD = TRUE;
}
#pragma push_macro("REGAMEDLL_ALLOC_FUNC")
#define REGAMEDLL_ALLOC_FUNC Regamedll_AllocEntities(gpGlobals->maxEntities);
LINK_ENTITY_TO_CLASS(worldspawn, CWorld);
LINK_CLASS_TO_WRAP(CWorld, CCSWorld);
#pragma pop_macro("REGAMEDLL_ALLOC_FUNC")
void CWorld::__MAKE_VHOOK(Spawn)()
{

View File

@ -475,7 +475,7 @@ void UTIL_DrawBeamPoints(Vector vecStart, Vector vecEnd, int iLifetime, byte bRe
MESSAGE_END();
}
void CONSOLE_ECHO(char *pszMsg, ...)
void CONSOLE_ECHO(const char *pszMsg, ...)
{
va_list argptr;
static char szStr[1024];
@ -487,7 +487,7 @@ void CONSOLE_ECHO(char *pszMsg, ...)
SERVER_PRINT(szStr);
}
void CONSOLE_ECHO_LOGGED(char *pszMsg, ...)
void CONSOLE_ECHO_LOGGED(const char *pszMsg, ...)
{
va_list argptr;
static char szStr[1024];

View File

@ -234,8 +234,8 @@ void UTIL_DrawBeamPoints(Vector vecStart, Vector vecEnd, int iLifetime, byte bRe
// Echos text to the console, and prints it on the client's screen. This is NOT tied to the developer cvar.
// If you are adding debugging output in cstrike, use UTIL_DPrintf() (debug.h) instead.
void CONSOLE_ECHO(char *pszMsg, ...);
void CONSOLE_ECHO_LOGGED(char *pszMsg, ...);
void CONSOLE_ECHO(const char *pszMsg, ...);
void CONSOLE_ECHO_LOGGED(const char *pszMsg, ...);
void BotPrecache();
void InitBotTrig();

View File

@ -91,6 +91,7 @@
#include <sys/types.h>
#include <sys/sysinfo.h>
#include <unistd.h>
#include <typeinfo>
// Deail with stupid macro in kernel.h
#undef __FUNCTION__

View File

@ -54,7 +54,7 @@
#define STEP_SNOW 9
#define WJ_HEIGHT 8
#define STOP_EPSILON 0.1
#define STOP_EPSILON 0.1
#define MAX_CLIMB_SPEED 200
#define PLAYER_DUCKING_MULTIPLIER 0.333
#define PM_CHECKSTUCK_MINTIME 0.05 // Don't check again too quickly.

View File

@ -25,4 +25,893 @@
* version.
*
*/
#pragma once
class CSave;
class Vector;
class CRestore;
class CCSEntity;
class CCSPlayer;
class CCSMonster;
class CCSWeaponBox;
class CCSPlayerItem;
class CCSPlayerWeapon;
class CCSquadMonster;
class ICSMonster;
class ICSquadMonster;
class ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Restart() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Activate() = 0;
virtual void SetObjectCollisionBox() = 0;
virtual int Classify() = 0;
virtual void DeathNotice(struct entvars_s *pevChild) = 0;
virtual void TraceAttack(struct entvars_s *pevAttacker, float flDamage, Vector vecDir, struct TraceResult *ptr, int bitsDamageType) = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual int TakeHealth(float flHealth, int bitsDamageType) = 0;
virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0;
virtual int BloodColor() = 0;
virtual void TraceBleed(float flDamage, Vector vecDir, struct TraceResult *ptr, int bitsDamageType) = 0;
virtual bool IsTriggered(CCSEntity *pActivator) = 0;
virtual ICSMonster *MyMonsterPointer() = 0;
virtual ICSquadMonster *MySquadMonsterPointer() = 0;
virtual int GetToggleState() = 0;
virtual void AddPoints(int score, bool bAllowNegativeScore) = 0;
virtual void AddPointsToTeam(int score, bool bAllowNegativeScore) = 0;
virtual bool AddPlayerItem(CCSPlayerItem *pItem) = 0;
virtual bool RemovePlayerItem(CCSPlayerItem *pItem) = 0;
virtual int GiveAmmo(int iAmount, char *szName, int iMax) = 0;
virtual float GetDelay() = 0;
virtual int IsMoving() = 0;
virtual void OverrideReset() = 0;
virtual int DamageDecal(int bitsDamageType) = 0;
virtual void SetToggleState(int state) = 0;
virtual void StartSneaking() = 0;
virtual void StopSneaking() = 0;
virtual bool OnControls(struct entvars_s *onpev) = 0;
virtual bool IsSneaking() = 0;
virtual bool IsAlive() = 0;
virtual bool IsBSPModel() = 0;
virtual bool ReflectGauss() = 0;
virtual bool HasTarget(string_t targetname) = 0;
virtual bool IsInWorld() = 0;
virtual bool IsPlayer() = 0;
virtual bool IsNetClient() = 0;
virtual const char *TeamID() = 0;
virtual ICSEntity *GetNextTarget() = 0;
virtual void Think() = 0;
virtual void Touch(CCSEntity *pOther) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType = USE_OFF, float value = 0.0f) = 0;
virtual void Blocked(CCSEntity *pOther) = 0;
virtual ICSEntity *Respawn() = 0;
virtual void UpdateOwner() = 0;
virtual bool FBecomeProne() = 0;
virtual Vector Center() = 0;
virtual Vector EyePosition() = 0;
virtual Vector EarPosition() = 0;
virtual Vector BodyTarget(const Vector &posSrc) = 0;
virtual int Illumination() = 0;
virtual bool FVisible(CCSEntity *pEntity) = 0;
virtual bool FVisible(const Vector &vecOrigin) = 0;
};
class ICSDelay: public ICSEntity {
public:
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
};
class ICSAnimating: public ICSDelay {
public:
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void HandleAnimEvent(struct MonsterEvent_s *pEvent) = 0;
};
class ICSPlayerItem: public ICSAnimating {
public:
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void SetObjectCollisionBox() = 0;
virtual ICSEntity *Respawn() = 0;
virtual int AddToPlayer(CCSPlayer *pPlayer) = 0;
virtual int AddDuplicate(CCSPlayerItem *pItem) = 0;
virtual int GetItemInfo(struct ItemInfo *p) = 0;
virtual bool CanDeploy() = 0;
virtual bool CanDrop() = 0;
virtual bool Deploy() = 0;
virtual bool IsWeapon() = 0;
virtual bool CanHolster() = 0;
virtual void Holster(int skiplocal = 0) = 0;
virtual void UpdateItemInfo() = 0;
virtual void ItemPreFrame() = 0;
virtual void ItemPostFrame() = 0;
virtual void Drop() = 0;
virtual void Kill() = 0;
virtual void AttachToPlayer(CCSPlayer *pPlayer) = 0;
virtual int PrimaryAmmoIndex() = 0;
virtual int SecondaryAmmoIndex() = 0;
virtual int UpdateClientData(CCSPlayer *pPlayer) = 0;
virtual ICSPlayerItem *GetWeaponPtr() = 0;
virtual float GetMaxSpeed() = 0;
virtual int iItemSlot() = 0;
};
class ICSPlayerWeapon: public ICSPlayerItem {
public:
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int AddToPlayer(CCSPlayer *pPlayer) = 0;
virtual int AddDuplicate(CCSPlayerItem *pItem) = 0;
virtual bool CanDeploy() = 0;
virtual bool IsWeapon() = 0;
virtual void Holster(int skiplocal = 0) = 0;
virtual void UpdateItemInfo() = 0;
virtual void ItemPostFrame() = 0;
virtual int PrimaryAmmoIndex() = 0;
virtual int SecondaryAmmoIndex() = 0;
virtual int UpdateClientData(CCSPlayer *pPlayer) = 0;
virtual ICSPlayerItem *GetWeaponPtr() = 0;
virtual int ExtractAmmo(CCSPlayerWeapon *pWeapon) = 0;
virtual int ExtractClipAmmo(CCSPlayerWeapon *pWeapon) = 0;
virtual int AddWeapon() = 0;
virtual bool PlayEmptySound() = 0;
virtual void ResetEmptySound() = 0;
virtual void SendWeaponAnim(int iAnim, int skiplocal = 0) = 0;
virtual bool IsUseable() = 0;
virtual void PrimaryAttack() = 0;
virtual void SecondaryAttack() = 0;
virtual void Reload() = 0;
virtual void WeaponIdle() = 0;
virtual void RetireWeapon() = 0;
virtual bool ShouldWeaponIdle() = 0;
virtual bool UseDecrement() = 0;
};
class ICSToggle: public ICSAnimating {
public:
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int GetToggleState() = 0;
virtual float GetDelay() = 0;
};
class ICSMonster: public ICSToggle {
public:
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void TraceAttack(struct entvars_s *pevAttacker, float flDamage, Vector vecDir, struct TraceResult *ptr, int bitsDamageType) = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual int TakeHealth(float flHealth, int bitsDamageType) = 0;
virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0;
virtual int BloodColor() = 0;
virtual bool IsAlive() = 0;
virtual float ChangeYaw(int speed) = 0;
virtual bool HasHumanGibs() = 0;
virtual bool HasAlienGibs() = 0;
virtual void FadeMonster() = 0;
virtual void GibMonster() = 0;
virtual enum Activity_s GetDeathActivity() = 0;
virtual void BecomeDead() = 0;
virtual bool ShouldFadeOnDeath() = 0;
virtual int IRelationship(CCSEntity *pTarget) = 0;
virtual void PainSound() = 0;
virtual void ResetMaxSpeed() = 0;
virtual void ReportAIState() = 0;
virtual void MonsterInitDead() = 0;
virtual void Look(int iDistance) = 0;
virtual ICSEntity *BestVisibleEnemy() = 0;
virtual bool FInViewCone(CCSEntity *pEntity) = 0;
virtual bool FInViewCone(const Vector *pOrigin) = 0;
};
class ICSWeaponBox: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void SetObjectCollisionBox() = 0;
virtual void Touch(CCSEntity *pOther) = 0;
};
class ICSPlayer: public ICSMonster {
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual int Classify() = 0;
virtual void TraceAttack(struct entvars_s *pevAttacker, float flDamage, Vector vecDir, struct TraceResult *ptr, int bitsDamageType) = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual int TakeHealth(float flHealth, int bitsDamageType) = 0;
virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0;
virtual void AddPoints(int score, bool bAllowNegativeScore) = 0;
virtual void AddPointsToTeam(int score, bool bAllowNegativeScore) = 0;
virtual bool AddPlayerItem(CCSPlayerItem *pItem) = 0;
virtual bool RemovePlayerItem(CCSPlayerItem *pItem) = 0;
virtual int GiveAmmo(int iAmount, char *szName, int iMax) = 0;
virtual void StartSneaking() = 0;
virtual void StopSneaking() = 0;
virtual bool IsSneaking() = 0;
virtual bool IsAlive() = 0;
virtual bool IsPlayer() = 0;
virtual bool IsNetClient() = 0;
virtual const char *TeamID() = 0;
virtual bool FBecomeProne() = 0;
virtual Vector BodyTarget(const Vector &posSrc) = 0;
virtual int Illumination() = 0;
virtual bool ShouldFadeOnDeath() = 0;
virtual void ResetMaxSpeed() = 0;
virtual void Jump() = 0;
virtual void Duck() = 0;
virtual void PreThink() = 0;
virtual void PostThink() = 0;
virtual Vector GetGunPosition() = 0;
virtual bool IsBot() = 0;
virtual void UpdateClientData() = 0;
virtual void ImpulseCommands() = 0;
virtual void RoundRespawn() = 0;
virtual Vector GetAutoaimVector(float flDelta) = 0;
virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha) = 0;
virtual void OnTouchingWeapon(CCSWeaponBox *pWeapon) = 0;
virtual bool IsConnected() const = 0;
};
class ICSWorld: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
};
class ICSGrenade: public ICSMonster {
public:
virtual void Spawn() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0;
virtual int BloodColor() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
virtual void BounceSound() = 0;
};
class ICSAirtank: public ICSGrenade {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0;
virtual int BloodColor() = 0;
};
class ICSPlayerAmmo: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
virtual ICSEntity *Respawn() = 0;
};
class ICS9MMAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICSBuckShotAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS556NatoAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS556NatoBoxAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS762NatoAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS45ACPAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS50AEAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS338MagnumAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS57MMAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICS357SIGAmmo: public ICSPlayerAmmo {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool AddAmmo(CCSEntity *pOther) = 0;
};
class ICSFuncWall: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFuncWallToggle: public ICSFuncWall {
public:
virtual void Spawn() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFuncConveyor: public ICSFuncWall {
public:
virtual void Spawn() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFuncIllusionary: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int ObjectCaps() = 0;
};
class ICSFuncMonsterClip: public ICSFuncWall {
public:
virtual void Spawn() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFuncRotating: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Blocked(CCSEntity *pOther) = 0;
};
class ICSPendulum: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Touch(CCSEntity *pOther) = 0;
virtual void Blocked(CCSEntity *pOther) = 0;
};
class ICSPointEntity: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual int ObjectCaps() = 0;
};
class ICSEnvGlobal: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSMultiSource: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual bool IsTriggered(CCSEntity *pActivator) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSButton: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
};
class ICSRotButton: public ICSButton {
public:
virtual void Spawn() = 0;
};
class ICSMomentaryRotButton: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSEnvSpark: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
};
class ICSButtonTarget: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual int ObjectCaps() = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSDoor: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Restart() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void SetToggleState(int state) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
virtual void Blocked(CCSEntity *pOther) = 0;
};
class ICSRotDoor: public ICSDoor {
public:
virtual void Spawn() = 0;
virtual void Restart() = 0;
virtual void SetToggleState(int state) = 0;
};
class ICSMomentaryDoor: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSGib: public ICSEntity {
public:
virtual int ObjectCaps() = 0;
};
class ICSBubbling: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSBeam: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual int ObjectCaps() = 0;
virtual Vector Center() = 0;
};
class ICSLightning: public ICSBeam {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Activate() = 0;
};
class ICSLaser: public ICSBeam {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSGlow: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Think() = 0;
};
class ICSSprite: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Restart() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSBombGlow: public ICSSprite {
public:
virtual void Spawn() = 0;
virtual void Think() = 0;
};
class ICSGibShooter: public ICSDelay {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
virtual ICSGib *CreateGib() = 0;
};
class ICSEnvShooter: public ICSGibShooter {
public:
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual ICSGib *CreateGib() = 0;
};
class ICSTestEffect: public ICSDelay {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSBlood: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSShake: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFade: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSMessage: public ICSPointEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSEnvFunnel: public ICSDelay {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSEnvBeverage: public ICSDelay {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSItemSoda: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
};
class ICSShower: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual int ObjectCaps() = 0;
virtual void Think() = 0;
virtual void Touch(CCSEntity *pOther) = 0;
};
class ICSEnvExplosion: public ICSMonster {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSBreakable: public ICSDelay {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void Restart() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void TraceAttack(struct entvars_s *pevAttacker, float flDamage, Vector vecDir, struct TraceResult *ptr, int bitsDamageType) = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual int DamageDecal(int bitsDamageType) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSPushable: public ICSBreakable {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual void Touch(CCSEntity *pOther) = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSFuncTank: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual bool OnControls(struct entvars_s *pevTest) = 0;
virtual void Think() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0;
virtual Vector UpdateTargetPosition(CCSEntity *pTarget) = 0;
};
class ICSFuncTankGun: public ICSFuncTank {
public:
virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0;
};
class ICSFuncTankLaser: public ICSFuncTank {
public:
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Activate() = 0;
virtual void Think() = 0;
virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0;
};
class ICSFuncTankRocket: public ICSFuncTank {
public:
virtual void Precache() = 0;
virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0;
};
class ICSFuncTankMortar: public ICSFuncTank {
public:
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0;
};
class ICSFuncTankControls: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Think() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSRecharge: public ICSToggle {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSCycler: public ICSMonster {
public:
virtual void Spawn() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual bool IsAlive() = 0;
virtual void Think() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSGenericCycler: public ICSCycler {
public:
virtual void Spawn() = 0;
};
class ICSCyclerProbe: public ICSCycler {
public:
virtual void Spawn() = 0;
};
class ICSCyclerSprite: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void Restart() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0;
virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual void Think() = 0;
virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0;
};
class ICSWeaponCycler: public ICSPlayerWeapon {
public:
virtual void Spawn() = 0;
virtual int GetItemInfo(struct ItemInfo *p) = 0;
virtual bool Deploy() = 0;
virtual void Holster(int skiplocal = 0) = 0;
virtual int iItemSlot() = 0;
virtual void PrimaryAttack() = 0;
virtual void SecondaryAttack() = 0;
};
class ICSWreckage: public ICSMonster {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0;
virtual void Think() = 0;
};
class ICSWorldItem: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual void KeyValue(struct KeyValueData_s *pkvd) = 0;
};
class ICSItem: public ICSEntity {
public:
virtual void Spawn() = 0;
virtual ICSEntity *Respawn() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSHealthKit: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemSuit: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemBattery: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemAntidote: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemSecurity: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemLongJump: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemKevlar: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemAssaultSuit: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};
class ICSItemThighPack: public ICSItem {
public:
virtual void Spawn() = 0;
virtual void Precache() = 0;
virtual bool MyTouch(CCSPlayer *pPlayer) = 0;
};

View File

@ -30,6 +30,7 @@
#include "interface.h"
#include "hookchains_impl.h"
#include "regamedll.h"
#include "regamedll_interfaces.h"
#include "regamedll_interfaces_impl.h"

View File

@ -28,3 +28,91 @@
#include "precompiled.h"
CCSEntity **g_GameEntities = NULL;
bool g_bInitialized = false;
void Regamedll_AllocEntities(int maxEdicts)
{
if (g_bInitialized)
return;
g_bInitialized = true;
g_GameEntities = (CCSEntity **)Q_malloc(sizeof(CCSEntity *) * maxEdicts);
Q_memset(g_GameEntities, 0, sizeof(CCSEntity *) * maxEdicts);
CONSOLE_ECHO(__FUNCTION__":: alloc entities!\n");
ADD_SERVER_COMMAND("check", [](){
Regamedll_MonitorEntities();
});
}
void Regamedll_FreeEntities(CBaseEntity *pEntity)
{
if (pEntity == NULL)
{
for (int i = 0; i < gpGlobals->maxEntities; ++i)
{
delete g_GameEntities[i];
g_GameEntities[i] = NULL;
}
Q_free(g_GameEntities);
g_GameEntities = NULL;
g_bInitialized = false;
return;
}
int index = pEntity->entindex();
if (index < 0 || index > gpGlobals->maxEntities)
return;
delete g_GameEntities[index];
g_GameEntities[index] = NULL;
CONSOLE_ECHO(__FUNCTION__ ":: Free on (#%d. %s)\n", index, STRING(pEntity->edict()->v.classname));
}
void Regamedll_MonitorEntities()
{
int nCount = 0;
for (int i = 0; i < gpGlobals->maxEntities; ++i)
{
if (g_GameEntities[i] == NULL)
continue;
++nCount;
}
CONSOLE_ECHO(__FUNCTION__":: nCount: (%d) (%d)\n", nCount, gpGlobals->maxEntities);
}
ICSPlayer *CBASE_TO_CSPLAYER(CBaseEntity *pEntity)
{
if (pEntity == NULL)
return NULL;
int index = pEntity->entindex();
if (index < 1 || index > gpGlobals->maxClients)
{
return NULL;
//regamedll_syserror(__FUNCTION__": Invalid player index %d", index);
}
return reinterpret_cast<ICSPlayer *>(g_GameEntities[index]);
}
ICSEntity *CBASE_TO_CSENTITY(CBaseEntity *pEntity)
{
if (pEntity == NULL)
return NULL;
int index = pEntity->entindex();
if (index < 0 || index > gpGlobals->maxEntities)
{
return NULL;
//regamedll_syserror(__FUNCTION__": Invalid entity index %d", index);
}
return g_GameEntities[index];
}

File diff suppressed because it is too large Load Diff