From 7b227c0edbb2fe663838e20bea58b19646a56a34 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Sun, 13 Mar 2016 19:11:22 +0600 Subject: [PATCH] Regamedll API WIP: implemented interfaces some objects. --- regamedll/dlls/activity.h | 2 +- regamedll/dlls/airtank.cpp | 1 + regamedll/dlls/airtank.h | 1 + regamedll/dlls/ammo.cpp | 10 + regamedll/dlls/ammo.h | 10 + regamedll/dlls/bmodels.cpp | 8 +- regamedll/dlls/bmodels.h | 7 + regamedll/dlls/buttons.cpp | 7 + regamedll/dlls/buttons.h | 10 +- regamedll/dlls/cbase.cpp | 7 + regamedll/dlls/cbase.h | 45 +- regamedll/dlls/client.cpp | 2 + regamedll/dlls/doors.cpp | 3 + regamedll/dlls/doors.h | 3 + regamedll/dlls/effects.cpp | 21 + regamedll/dlls/effects.h | 17 + regamedll/dlls/enginecallback.h | 2 +- regamedll/dlls/explode.cpp | 2 + regamedll/dlls/explode.h | 2 + regamedll/dlls/func_break.cpp | 2 + regamedll/dlls/func_break.h | 4 +- regamedll/dlls/func_tank.cpp | 6 + regamedll/dlls/func_tank.h | 9 +- regamedll/dlls/game.cpp | 5 + regamedll/dlls/game.h | 1 + regamedll/dlls/gamerules.h | 2 +- regamedll/dlls/ggrenade.cpp | 1 + regamedll/dlls/h_battery.cpp | 1 + regamedll/dlls/h_battery.h | 1 + regamedll/dlls/h_cycler.cpp | 7 + regamedll/dlls/h_cycler.h | 6 + regamedll/dlls/healthkit.cpp | 1 + regamedll/dlls/healthkit.h | 1 + regamedll/dlls/items.cpp | 11 + regamedll/dlls/items.h | 10 + regamedll/dlls/monsterevent.h | 2 +- regamedll/dlls/player.cpp | 1 + regamedll/dlls/player.h | 1 + regamedll/dlls/sound.h | 2 +- regamedll/dlls/subs.cpp | 1 + regamedll/dlls/triggers.h | 10 +- regamedll/dlls/util.h | 10 +- regamedll/dlls/weapons.cpp | 1 + regamedll/dlls/weapons.h | 2 + regamedll/dlls/world.cpp | 6 + regamedll/game_shared/bot/bot_util.cpp | 4 +- regamedll/game_shared/bot/bot_util.h | 4 +- regamedll/hookers/osconfig.h | 1 + regamedll/pm_shared/pm_shared.h | 2 +- .../public/regamedll/regamedll_interfaces.h | 889 ++++++++++++++ regamedll/regamedll/precompiled.h | 1 + .../regamedll/regamedll_interfaces_impl.cpp | 88 ++ .../regamedll/regamedll_interfaces_impl.h | 1081 +++++++++++++++++ 53 files changed, 2302 insertions(+), 32 deletions(-) diff --git a/regamedll/dlls/activity.h b/regamedll/dlls/activity.h index 379299a4..573ce4ff 100644 --- a/regamedll/dlls/activity.h +++ b/regamedll/dlls/activity.h @@ -32,7 +32,7 @@ #pragma once #endif -typedef enum +typedef enum Activity_s { ACT_INVALID = -1, diff --git a/regamedll/dlls/airtank.cpp b/regamedll/dlls/airtank.cpp index 6d2bc0cf..27e5178f 100644 --- a/regamedll/dlls/airtank.cpp +++ b/regamedll/dlls/airtank.cpp @@ -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)() diff --git a/regamedll/dlls/airtank.h b/regamedll/dlls/airtank.h index 89ff2eb9..305dc2f1 100644 --- a/regamedll/dlls/airtank.h +++ b/regamedll/dlls/airtank.h @@ -35,6 +35,7 @@ class CAirtank: public CGrenade { public: + CAirtank(); virtual void Spawn(); virtual void Precache(); virtual int Save(CSave &save); diff --git a/regamedll/dlls/ammo.cpp b/regamedll/dlls/ammo.cpp index 16fa5bfc..5313a7a2 100644 --- a/regamedll/dlls/ammo.cpp +++ b/regamedll/dlls/ammo.cpp @@ -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); diff --git a/regamedll/dlls/ammo.h b/regamedll/dlls/ammo.h index 6118fa28..b3ab0e9d 100644 --- a/regamedll/dlls/ammo.h +++ b/regamedll/dlls/ammo.h @@ -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); diff --git a/regamedll/dlls/bmodels.cpp b/regamedll/dlls/bmodels.cpp index 7b992a4e..61801101 100644 --- a/regamedll/dlls/bmodels.cpp +++ b/regamedll/dlls/bmodels.cpp @@ -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) diff --git a/regamedll/dlls/bmodels.h b/regamedll/dlls/bmodels.h index c32aa2cd..10974d37 100644 --- a/regamedll/dlls/bmodels.h +++ b/regamedll/dlls/bmodels.h @@ -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); diff --git a/regamedll/dlls/buttons.cpp b/regamedll/dlls/buttons.cpp index 339a32de..54a65fde 100644 --- a/regamedll/dlls/buttons.cpp +++ b/regamedll/dlls/buttons.cpp @@ -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)() { diff --git a/regamedll/dlls/buttons.h b/regamedll/dlls/buttons.h index eeefd34f..d9f5127d 100644 --- a/regamedll/dlls/buttons.h +++ b/regamedll/dlls/buttons.h @@ -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); diff --git a/regamedll/dlls/cbase.cpp b/regamedll/dlls/cbase.cpp index 77293413..85352ef0 100644 --- a/regamedll/dlls/cbase.cpp +++ b/regamedll/dlls/cbase.cpp @@ -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); diff --git a/regamedll/dlls/cbase.h b/regamedll/dlls/cbase.h index 45146f7c..ae5a377f 100644 --- a/regamedll/dlls/cbase.h +++ b/regamedll/dlls/cbase.h @@ -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 +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(g_GameEntities[index]); +} + template 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())); diff --git a/regamedll/dlls/client.cpp b/regamedll/dlls/client.cpp index d949b637..b308b924 100644 --- a/regamedll/dlls/client.cpp +++ b/regamedll/dlls/client.cpp @@ -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(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()) { diff --git a/regamedll/dlls/doors.cpp b/regamedll/dlls/doors.cpp index 05edec55..bc9cbd78 100644 --- a/regamedll/dlls/doors.cpp +++ b/regamedll/dlls/doors.cpp @@ -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)() diff --git a/regamedll/dlls/doors.h b/regamedll/dlls/doors.h index 7f266b32..bac668cc 100644 --- a/regamedll/dlls/doors.h +++ b/regamedll/dlls/doors.h @@ -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); diff --git a/regamedll/dlls/effects.cpp b/regamedll/dlls/effects.cpp index 0cf32c2a..f98cc834 100644 --- a/regamedll/dlls/effects.cpp +++ b/regamedll/dlls/effects.cpp @@ -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)() { diff --git a/regamedll/dlls/effects.h b/regamedll/dlls/effects.h index 7e6a38f1..82b50970 100644 --- a/regamedll/dlls/effects.h +++ b/regamedll/dlls/effects.h @@ -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(); diff --git a/regamedll/dlls/enginecallback.h b/regamedll/dlls/enginecallback.h index 58f3cedb..def9217c 100644 --- a/regamedll/dlls/enginecallback.h +++ b/regamedll/dlls/enginecallback.h @@ -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) diff --git a/regamedll/dlls/explode.cpp b/regamedll/dlls/explode.cpp index 476e18b7..9a31f883 100644 --- a/regamedll/dlls/explode.cpp +++ b/regamedll/dlls/explode.cpp @@ -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) { diff --git a/regamedll/dlls/explode.h b/regamedll/dlls/explode.h index eaf5e8be..1ea45d35 100644 --- a/regamedll/dlls/explode.h +++ b/regamedll/dlls/explode.h @@ -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); diff --git a/regamedll/dlls/func_break.cpp b/regamedll/dlls/func_break.cpp index cc8ad433..487cbdd7 100644 --- a/regamedll/dlls/func_break.cpp +++ b/regamedll/dlls/func_break.cpp @@ -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)() diff --git a/regamedll/dlls/func_break.h b/regamedll/dlls/func_break.h index 0d15d4f2..fba4c986 100644 --- a/regamedll/dlls/func_break.h +++ b/regamedll/dlls/func_break.h @@ -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); diff --git a/regamedll/dlls/func_tank.cpp b/regamedll/dlls/func_tank.cpp index 83d9de7c..27227d63 100644 --- a/regamedll/dlls/func_tank.cpp +++ b/regamedll/dlls/func_tank.cpp @@ -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) diff --git a/regamedll/dlls/func_tank.h b/regamedll/dlls/func_tank.h index a21a8b4b..e3e87040 100644 --- a/regamedll/dlls/func_tank.h +++ b/regamedll/dlls/func_tank.h @@ -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; }; diff --git a/regamedll/dlls/game.cpp b/regamedll/dlls/game.cpp index e84ac2c4..7fdd0992 100644 --- a/regamedll/dlls/game.cpp +++ b/regamedll/dlls/game.cpp @@ -233,3 +233,8 @@ void EXT_FUNC GameDLLInit() Tutor_RegisterCVars(); Hostage_RegisterCVars(); } + +void EXT_FUNC GameDLLShutdown() +{ + Regamedll_FreeEntities(); +} diff --git a/regamedll/dlls/game.h b/regamedll/dlls/game.h index 18358028..85fe908a 100644 --- a/regamedll/dlls/game.h +++ b/regamedll/dlls/game.h @@ -139,5 +139,6 @@ extern cvar_t round_infinite; #endif void GameDLLInit(); +void GameDLLShutdown(); #endif // GAME_H diff --git a/regamedll/dlls/gamerules.h b/regamedll/dlls/gamerules.h index d2f498b4..c46dd77e 100644 --- a/regamedll/dlls/gamerules.h +++ b/regamedll/dlls/gamerules.h @@ -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 diff --git a/regamedll/dlls/ggrenade.cpp b/regamedll/dlls/ggrenade.cpp index 0460e1e2..34a03e06 100644 --- a/regamedll/dlls/ggrenade.cpp +++ b/regamedll/dlls/ggrenade.cpp @@ -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) { diff --git a/regamedll/dlls/h_battery.cpp b/regamedll/dlls/h_battery.cpp index 08a11186..b3ea0379 100644 --- a/regamedll/dlls/h_battery.cpp +++ b/regamedll/dlls/h_battery.cpp @@ -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) { diff --git a/regamedll/dlls/h_battery.h b/regamedll/dlls/h_battery.h index d9e6fa67..ba2fab0d 100644 --- a/regamedll/dlls/h_battery.h +++ b/regamedll/dlls/h_battery.h @@ -35,6 +35,7 @@ class CRecharge: public CBaseToggle { public: + CRecharge(); virtual void Spawn(); virtual void Precache(); virtual void KeyValue(KeyValueData *pkvd); diff --git a/regamedll/dlls/h_cycler.cpp b/regamedll/dlls/h_cycler.cpp index ddbf9071..e31ef323 100644 --- a/regamedll/dlls/h_cycler.cpp +++ b/regamedll/dlls/h_cycler.cpp @@ -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)() { diff --git a/regamedll/dlls/h_cycler.h b/regamedll/dlls/h_cycler.h index bc5af4db..59447971 100644 --- a/regamedll/dlls/h_cycler.h +++ b/regamedll/dlls/h_cycler.h @@ -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); diff --git a/regamedll/dlls/healthkit.cpp b/regamedll/dlls/healthkit.cpp index f65b956c..19aba039 100644 --- a/regamedll/dlls/healthkit.cpp +++ b/regamedll/dlls/healthkit.cpp @@ -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)() { diff --git a/regamedll/dlls/healthkit.h b/regamedll/dlls/healthkit.h index 6242628c..2e4eb2c7 100644 --- a/regamedll/dlls/healthkit.h +++ b/regamedll/dlls/healthkit.h @@ -35,6 +35,7 @@ class CHealthKit: public CItem { public: + CHealthKit(); virtual void Spawn(); virtual void Precache(); virtual BOOL MyTouch(CBasePlayer *pPlayer); diff --git a/regamedll/dlls/items.cpp b/regamedll/dlls/items.cpp index d3a50f86..a43e2e90 100644 --- a/regamedll/dlls/items.cpp +++ b/regamedll/dlls/items.cpp @@ -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); diff --git a/regamedll/dlls/items.h b/regamedll/dlls/items.h index 3ff709f0..41a74dcf 100644 --- a/regamedll/dlls/items.h +++ b/regamedll/dlls/items.h @@ -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); diff --git a/regamedll/dlls/monsterevent.h b/regamedll/dlls/monsterevent.h index 703ad669..43529c30 100644 --- a/regamedll/dlls/monsterevent.h +++ b/regamedll/dlls/monsterevent.h @@ -32,7 +32,7 @@ #pragma once #endif -typedef struct +typedef struct MonsterEvent_s { int event; char *options; diff --git a/regamedll/dlls/player.cpp b/regamedll/dlls/player.cpp index db6913fa..b95ab5a4 100644 --- a/regamedll/dlls/player.cpp +++ b/regamedll/dlls/player.cpp @@ -324,6 +324,7 @@ void WriteSigonMessages() } LINK_ENTITY_TO_CLASS(player, CBasePlayer); +LINK_CLASS_TO_WRAP(CBasePlayer, CCSPlayer); void SendItemStatus(CBasePlayer *pPlayer) { diff --git a/regamedll/dlls/player.h b/regamedll/dlls/player.h index 9751d064..26342c41 100644 --- a/regamedll/dlls/player.h +++ b/regamedll/dlls/player.h @@ -352,6 +352,7 @@ public: class CBasePlayer: public CBaseMonster { public: + CBasePlayer(); virtual void Spawn(); virtual void Precache(); virtual int Save(CSave &save); diff --git a/regamedll/dlls/sound.h b/regamedll/dlls/sound.h index 2fdbfc20..8ccf0f28 100644 --- a/regamedll/dlls/sound.h +++ b/regamedll/dlls/sound.h @@ -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 diff --git a/regamedll/dlls/subs.cpp b/regamedll/dlls/subs.cpp index 97634956..ba3131ed 100644 --- a/regamedll/dlls/subs.cpp +++ b/regamedll/dlls/subs.cpp @@ -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) { diff --git a/regamedll/dlls/triggers.h b/regamedll/dlls/triggers.h index 6d727d1c..526ba39b 100644 --- a/regamedll/dlls/triggers.h +++ b/regamedll/dlls/triggers.h @@ -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. diff --git a/regamedll/dlls/util.h b/regamedll/dlls/util.h index d3a4c7c2..c702dea5 100644 --- a/regamedll/dlls/util.h +++ b/regamedll/dlls/util.h @@ -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(this);\ + }\ + typedef enum { ignore_monsters = 1, diff --git a/regamedll/dlls/weapons.cpp b/regamedll/dlls/weapons.cpp index c5e1e899..9888d3f4 100644 --- a/regamedll/dlls/weapons.cpp +++ b/regamedll/dlls/weapons.cpp @@ -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)() diff --git a/regamedll/dlls/weapons.h b/regamedll/dlls/weapons.h index df1e83d7..fbf2994f 100644 --- a/regamedll/dlls/weapons.h +++ b/regamedll/dlls/weapons.h @@ -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); diff --git a/regamedll/dlls/world.cpp b/regamedll/dlls/world.cpp index 3b3e4717..961aaf29 100644 --- a/regamedll/dlls/world.cpp +++ b/regamedll/dlls/world.cpp @@ -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)() { diff --git a/regamedll/game_shared/bot/bot_util.cpp b/regamedll/game_shared/bot/bot_util.cpp index e29b5d58..64c32218 100644 --- a/regamedll/game_shared/bot/bot_util.cpp +++ b/regamedll/game_shared/bot/bot_util.cpp @@ -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]; diff --git a/regamedll/game_shared/bot/bot_util.h b/regamedll/game_shared/bot/bot_util.h index 61df2765..4911faed 100644 --- a/regamedll/game_shared/bot/bot_util.h +++ b/regamedll/game_shared/bot/bot_util.h @@ -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(); diff --git a/regamedll/hookers/osconfig.h b/regamedll/hookers/osconfig.h index f0535ae0..63c9ba96 100644 --- a/regamedll/hookers/osconfig.h +++ b/regamedll/hookers/osconfig.h @@ -91,6 +91,7 @@ #include #include #include + #include // Deail with stupid macro in kernel.h #undef __FUNCTION__ diff --git a/regamedll/pm_shared/pm_shared.h b/regamedll/pm_shared/pm_shared.h index 5d741eed..e9fe639e 100644 --- a/regamedll/pm_shared/pm_shared.h +++ b/regamedll/pm_shared/pm_shared.h @@ -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. diff --git a/regamedll/public/regamedll/regamedll_interfaces.h b/regamedll/public/regamedll/regamedll_interfaces.h index 60cc3782..481d8dbd 100644 --- a/regamedll/public/regamedll/regamedll_interfaces.h +++ b/regamedll/public/regamedll/regamedll_interfaces.h @@ -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; +}; + diff --git a/regamedll/regamedll/precompiled.h b/regamedll/regamedll/precompiled.h index 0b751beb..acb43c3a 100644 --- a/regamedll/regamedll/precompiled.h +++ b/regamedll/regamedll/precompiled.h @@ -30,6 +30,7 @@ #include "interface.h" #include "hookchains_impl.h" + #include "regamedll.h" #include "regamedll_interfaces.h" #include "regamedll_interfaces_impl.h" diff --git a/regamedll/regamedll/regamedll_interfaces_impl.cpp b/regamedll/regamedll/regamedll_interfaces_impl.cpp index 938550fb..af9b19fe 100644 --- a/regamedll/regamedll/regamedll_interfaces_impl.cpp +++ b/regamedll/regamedll/regamedll_interfaces_impl.cpp @@ -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(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]; +} diff --git a/regamedll/regamedll/regamedll_interfaces_impl.h b/regamedll/regamedll/regamedll_interfaces_impl.h index 4cd6e926..e7e8c323 100644 --- a/regamedll/regamedll/regamedll_interfaces_impl.h +++ b/regamedll/regamedll/regamedll_interfaces_impl.h @@ -29,3 +29,1084 @@ #include "maintypes.h" #include "regamedll_interfaces.h" + +class CCSEntity; +class CCSPlayer; +class CCSMonster; +class CBaseEntity; +class CCSquadMonster; + +extern CCSEntity **g_GameEntities; +extern ICSEntity *CBASE_TO_CSENTITY(CBaseEntity *pEntity); +extern ICSPlayer *CBASE_TO_CSPLAYER(CBaseEntity *pEntity); + +class CCSEntity: public ICSEntity { +public: + CBaseEntity *m_pEntity; + CCSEntity(CBaseEntity *pEntity) : m_pEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Activate() { m_pEntity->Activate(); } + virtual void SetObjectCollisionBox() { m_pEntity->SetObjectCollisionBox(); } + virtual int Classify() { return m_pEntity->Classify(); } + virtual void DeathNotice(entvars_t *pevChild) { m_pEntity->DeathNotice(pevChild); } + virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { m_pEntity->TraceAttack(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual int TakeHealth(float flHealth, int bitsDamageType) { return m_pEntity->TakeHealth(flHealth, bitsDamageType); } + virtual void Killed(entvars_t *pevAttacker, int iGib) { m_pEntity->Killed(pevAttacker, iGib); } + virtual int BloodColor() { return m_pEntity->BloodColor(); } + virtual void TraceBleed(float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { m_pEntity->TraceBleed(flDamage, vecDir, ptr, bitsDamageType); } + virtual bool IsTriggered(CCSEntity *pActivator) { return m_pEntity->IsTriggered(pActivator->m_pEntity) ? TRUE : FALSE; } + virtual ICSMonster *MyMonsterPointer() { return (ICSMonster *)CBASE_TO_CSENTITY(m_pEntity->MyMonsterPointer()); } + virtual ICSquadMonster *MySquadMonsterPointer() { return (ICSquadMonster *)m_pEntity->MySquadMonsterPointer(); } + virtual int GetToggleState() { return m_pEntity->GetToggleState(); } + virtual void AddPoints(int score, bool bAllowNegativeScore) { m_pEntity->AddPoints(score, bAllowNegativeScore ? TRUE : FALSE); } + virtual void AddPointsToTeam(int score, bool bAllowNegativeScore) { m_pEntity->AddPointsToTeam(score, bAllowNegativeScore ? TRUE : FALSE); } + virtual bool AddPlayerItem(CCSPlayerItem *pItem) { return m_pEntity->AddPlayerItem((CBasePlayerItem *)((CCSEntity *)pItem)->m_pEntity) ? true : false; } + virtual bool RemovePlayerItem(CCSPlayerItem *pItem) { return m_pEntity->RemovePlayerItem((CBasePlayerItem *)((CCSEntity *)pItem)->m_pEntity) ? true : false; } + virtual int GiveAmmo(int iAmount, char *szName, int iMax) { return m_pEntity->GiveAmmo(iAmount, szName, iMax); } + virtual float GetDelay() { return m_pEntity->GetDelay(); } + virtual int IsMoving() { return m_pEntity->IsMoving(); } + virtual void OverrideReset() { m_pEntity->OverrideReset(); } + virtual int DamageDecal(int bitsDamageType) { return m_pEntity->DamageDecal(bitsDamageType); } + virtual void SetToggleState(int state) { m_pEntity->SetToggleState(state); } + virtual void StartSneaking() { m_pEntity->StartSneaking(); } + virtual void StopSneaking() { m_pEntity->StopSneaking(); } + virtual bool OnControls(entvars_t *onpev) { return m_pEntity->OnControls(onpev) ? true : false; } + virtual bool IsSneaking() { return m_pEntity->IsSneaking() ? true : false; } + virtual bool IsAlive() { return m_pEntity->IsAlive() ? true : false; } + virtual bool IsBSPModel() { return m_pEntity->IsBSPModel() ? true : false; } + virtual bool ReflectGauss() { return m_pEntity->ReflectGauss() ? true : false; } + virtual bool HasTarget(string_t targetname) { return m_pEntity->HasTarget(targetname) ? true : false; } + virtual bool IsInWorld() { return m_pEntity->IsInWorld() ? true : false; } + virtual bool IsPlayer() { return m_pEntity->IsPlayer() ? true : false; } + virtual bool IsNetClient() { return m_pEntity->IsNetClient() ? true : false; } + virtual const char *TeamID() { return m_pEntity->TeamID(); } + virtual ICSEntity *GetNextTarget() { return CBASE_TO_CSENTITY(m_pEntity->GetNextTarget()); } + virtual void Think() { m_pEntity->Think(); } + virtual void Touch(CCSEntity *pOther) { m_pEntity->Touch(pOther->m_pEntity); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } + virtual void Blocked(CCSEntity *pOther) { m_pEntity->Blocked(pOther->m_pEntity); } + virtual ICSEntity *Respawn() { return CBASE_TO_CSENTITY(m_pEntity->Respawn()); } + virtual void UpdateOwner() { m_pEntity->UpdateOwner(); } + virtual bool FBecomeProne() { return m_pEntity->FBecomeProne() ? true : false; } + virtual Vector Center() { return m_pEntity->Center(); } + virtual Vector EyePosition() { return m_pEntity->EyePosition(); } + virtual Vector EarPosition() { return m_pEntity->EarPosition(); } + virtual Vector BodyTarget(const Vector &posSrc) { return m_pEntity->BodyTarget(posSrc); } + virtual int Illumination() { return m_pEntity->Illumination(); } + virtual bool FVisible(CCSEntity *pEntity) { return m_pEntity->FVisible(pEntity->m_pEntity) ? true : false; } + virtual bool FVisible(const Vector &vecOrigin) { return m_pEntity->FVisible(vecOrigin) ? true : false; } +}; + +class CCSDelay: public CCSEntity { +public: + CCSDelay(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } +}; + +class CCSAnimating: public CCSDelay { +public: + CCSAnimating(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void HandleAnimEvent(MonsterEvent_t *pEvent) { return ((CBaseAnimating *)m_pEntity)->HandleAnimEvent(pEvent); } +}; + +class CCSPlayerItem: public CCSAnimating { +public: + CCSPlayerItem(CBaseEntity *pEntity) : CCSAnimating(pEntity) {} +public: + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void SetObjectCollisionBox() { m_pEntity->SetObjectCollisionBox(); } + virtual ICSEntity *Respawn() { return CBASE_TO_CSENTITY(m_pEntity->Respawn()); } + virtual int AddToPlayer(CCSPlayer *pPlayer) { return ((CBasePlayerItem *)m_pEntity)->AddToPlayer((CBasePlayer *)((CCSEntity *)pPlayer)->m_pEntity); } + virtual int AddDuplicate(CCSPlayerItem *pItem) { return ((CBasePlayerItem *)m_pEntity)->AddDuplicate((CBasePlayerItem *)pItem->m_pEntity); } + virtual int GetItemInfo(ItemInfo *p) { return ((CBasePlayerItem *)m_pEntity)->GetItemInfo(p); } + virtual bool CanDeploy() { return ((CBasePlayerItem *)m_pEntity)->CanDeploy() ? true : false; } + virtual bool CanDrop() { return ((CBasePlayerItem *)m_pEntity)->CanDrop() ? true : false; } + virtual bool Deploy() { return ((CBasePlayerItem *)m_pEntity)->Deploy() ? true : false; } + virtual bool IsWeapon() { return ((CBasePlayerItem *)m_pEntity)->IsWeapon() ? true : false; } + virtual bool CanHolster() { return ((CBasePlayerItem *)m_pEntity)->CanHolster() ? true : false; } + virtual void Holster(int skiplocal) { ((CBasePlayerItem *)m_pEntity)->Holster(skiplocal); } + virtual void UpdateItemInfo() { ((CBasePlayerItem *)m_pEntity)->UpdateItemInfo(); } + virtual void ItemPreFrame() { ((CBasePlayerItem *)m_pEntity)->ItemPreFrame(); } + virtual void ItemPostFrame() { ((CBasePlayerItem *)m_pEntity)->ItemPostFrame(); } + virtual void Drop() { ((CBasePlayerItem *)m_pEntity)->Drop(); } + virtual void Kill() { ((CBasePlayerItem *)m_pEntity)->Kill(); } + virtual void AttachToPlayer(CCSPlayer *pPlayer) { ((CBasePlayerItem *)m_pEntity)->AttachToPlayer((CBasePlayer *)((CCSEntity *)pPlayer)->m_pEntity); } + virtual int PrimaryAmmoIndex() { ((CBasePlayerItem *)m_pEntity)->PrimaryAmmoIndex(); } + virtual int SecondaryAmmoIndex() { ((CBasePlayerItem *)m_pEntity)->SecondaryAmmoIndex(); } + virtual int UpdateClientData(CCSPlayer *pPlayer) { ((CBasePlayerItem *)m_pEntity)->UpdateClientData((CBasePlayer *)((CCSEntity *)pPlayer)->m_pEntity); } + virtual ICSPlayerItem *GetWeaponPtr() { ((CBasePlayerItem *)m_pEntity)->GetWeaponPtr(); } + virtual float GetMaxSpeed() { ((CBasePlayerItem *)m_pEntity)->GetMaxSpeed(); } + virtual int iItemSlot() { ((CBasePlayerItem *)m_pEntity)->iItemSlot(); } +}; + +class CCSToggle: public CCSAnimating { +public: + CCSToggle(CBaseEntity *pEntity) : CCSAnimating(pEntity) {} +public: + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int GetToggleState() { return m_pEntity->GetToggleState(); } + virtual float GetDelay() { return m_pEntity->GetDelay(); } +}; + +class CCSMonster: public CCSToggle { +public: + CCSMonster(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { m_pEntity->TraceAttack(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual int TakeHealth(float flHealth, int bitsDamageType) { return m_pEntity->TakeHealth(flHealth, bitsDamageType); } + virtual void Killed(entvars_t *pevAttacker, int iGib) { m_pEntity->Killed(pevAttacker, iGib); } + virtual int BloodColor() { return m_pEntity->BloodColor(); } + virtual bool IsAlive() { return m_pEntity->IsAlive() ? true : false; } + virtual float ChangeYaw(int speed) { return ((CBaseMonster *)m_pEntity)->ChangeYaw(speed); } + virtual bool HasHumanGibs() { return ((CBaseMonster *)m_pEntity)->HasHumanGibs() ? true : false; } + virtual bool HasAlienGibs() { return ((CBaseMonster *)m_pEntity)->HasAlienGibs() ? true : false; } + virtual void FadeMonster() { ((CBaseMonster *)m_pEntity)->FadeMonster(); } + virtual void GibMonster() { ((CBaseMonster *)m_pEntity)->GibMonster(); } + virtual Activity GetDeathActivity() { return ((CBaseMonster *)m_pEntity)->GetDeathActivity(); } + virtual void BecomeDead() { ((CBaseMonster *)m_pEntity)->BecomeDead(); } + virtual bool ShouldFadeOnDeath() { return ((CBaseMonster *)m_pEntity)->ShouldFadeOnDeath() ? true : false; } + virtual int IRelationship(CCSEntity *pTarget) { return ((CBaseMonster *)m_pEntity)->IRelationship(pTarget->m_pEntity); } + virtual void PainSound() { ((CBaseMonster *)m_pEntity)->PainSound(); } + virtual void ResetMaxSpeed() { ((CBaseMonster *)m_pEntity)->ResetMaxSpeed(); } + virtual void ReportAIState() { ((CBaseMonster *)m_pEntity)->ReportAIState(); } + virtual void MonsterInitDead() { ((CBaseMonster *)m_pEntity)->MonsterInitDead(); } + virtual void Look(int iDistance) { ((CBaseMonster *)m_pEntity)->Look(iDistance); } + virtual ICSEntity *BestVisibleEnemy() { return CBASE_TO_CSENTITY(((CBaseMonster *)m_pEntity)->BestVisibleEnemy()); } + virtual bool FInViewCone(CCSEntity *pEntity) { return ((CBaseMonster *)m_pEntity)->FInViewCone(pEntity->m_pEntity) ? true : false; } + virtual bool FInViewCone(const Vector *pOrigin) { return ((CBaseMonster *)m_pEntity)->FInViewCone(pOrigin) ? true : false; } +}; + +class CCSWeaponBox: public CCSEntity { +public: + CCSWeaponBox(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void SetObjectCollisionBox() { m_pEntity->SetObjectCollisionBox(); } + virtual void Touch(CCSEntity *pOther) { m_pEntity->Touch(pOther->m_pEntity); } +}; + +class CCSPlayer: public CCSMonster { +private: + bool m_bConnected; +public: + CCSPlayer(CBaseEntity *pEntity) : CCSMonster(pEntity) {} + void OnClientConnected() { m_bConnected = true; } + void OnClientDisconnected() { m_bConnected = false; } + + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual int Classify() { return m_pEntity->Classify(); } + virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { m_pEntity->TraceAttack(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual int TakeHealth(float flHealth, int bitsDamageType) { return m_pEntity->TakeHealth(flHealth, bitsDamageType); } + virtual void Killed(entvars_t *pevAttacker, int iGib) { m_pEntity->Killed(pevAttacker, iGib); } + virtual void AddPoints(int score, bool bAllowNegativeScore) { m_pEntity->AddPoints(score, bAllowNegativeScore ? TRUE : FALSE); } + virtual void AddPointsToTeam(int score, bool bAllowNegativeScore) { m_pEntity->AddPointsToTeam(score, bAllowNegativeScore ? TRUE : FALSE); } + virtual bool AddPlayerItem(CCSPlayerItem *pItem) { return m_pEntity->AddPlayerItem((CBasePlayerItem *)pItem->m_pEntity) ? true : false; } + virtual bool RemovePlayerItem(CCSPlayerItem *pItem) { return m_pEntity->RemovePlayerItem((CBasePlayerItem *)pItem->m_pEntity) ? true : false; } + virtual int GiveAmmo(int iAmount, char *szName, int iMax) { return m_pEntity->GiveAmmo(iAmount, szName, iMax); } + virtual void StartSneaking() { m_pEntity->StartSneaking(); } + virtual void StopSneaking() { m_pEntity->StopSneaking(); } + virtual bool IsSneaking() { return m_pEntity->IsSneaking() ? true : false; } + virtual bool IsAlive() { return m_pEntity->IsAlive() ? true : false; } + virtual bool IsPlayer() { return m_pEntity->IsPlayer() ? true : false; } + virtual bool IsNetClient() { return m_pEntity->IsNetClient() ? true : false; } + virtual const char *TeamID() { return m_pEntity->TeamID(); } + virtual bool FBecomeProne() { return m_pEntity->FBecomeProne() ? true : false; } + virtual Vector BodyTarget(const Vector &posSrc) { return m_pEntity->BodyTarget(posSrc); } + virtual int Illumination() { return m_pEntity->Illumination(); } + virtual bool ShouldFadeOnDeath() { return ((CBasePlayer *)m_pEntity)->ShouldFadeOnDeath() ? true : false; } + virtual void ResetMaxSpeed() { ((CBasePlayer *)m_pEntity)->ResetMaxSpeed(); } + virtual void Jump() { ((CBasePlayer *)m_pEntity)->Jump(); } + virtual void Duck() { ((CBasePlayer *)m_pEntity)->Duck(); } + virtual void PreThink() { ((CBasePlayer *)m_pEntity)->PreThink(); } + virtual void PostThink() { ((CBasePlayer *)m_pEntity)->PostThink(); } + virtual Vector GetGunPosition() { ((CBasePlayer *)m_pEntity)->GetGunPosition(); } + virtual bool IsBot() { return ((CBasePlayer *)m_pEntity)->IsBot() ? true : false; } + virtual void UpdateClientData() { ((CBasePlayer *)m_pEntity)->UpdateClientData(); } + virtual void ImpulseCommands() { ((CBasePlayer *)m_pEntity)->ImpulseCommands(); } + virtual void RoundRespawn() { ((CBasePlayer *)m_pEntity)->RoundRespawn(); } + virtual Vector GetAutoaimVector(float flDelta) { ((CBasePlayer *)m_pEntity)->GetAutoaimVector(flDelta); } + virtual void Blind(float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha) { ((CBasePlayer *)m_pEntity)->Blind(flUntilTime, flHoldTime, flFadeTime, iAlpha); } + virtual void OnTouchingWeapon(CCSWeaponBox *pWeapon) { ((CBasePlayer *)m_pEntity)->OnTouchingWeapon((CWeaponBox *)pWeapon->m_pEntity); } +public: + virtual bool IsConnected() const { return m_bConnected; } +}; + +class CCSPlayerWeapon: public CCSPlayerItem { +public: + CCSPlayerWeapon(CBaseEntity *pEntity) : CCSPlayerItem(pEntity) {} +public: + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int AddToPlayer(CCSPlayer *pPlayer) { return ((CBasePlayerWeapon *)m_pEntity)->AddToPlayer((CBasePlayer *)pPlayer->m_pEntity); } + virtual int AddDuplicate(CCSPlayerItem *pItem) { return ((CBasePlayerWeapon *)m_pEntity)->AddDuplicate((CBasePlayerItem *)pItem->m_pEntity); } + virtual bool CanDeploy() { return ((CBasePlayerWeapon *)m_pEntity)->CanDeploy() ? true : false; } + virtual bool IsWeapon() { return ((CBasePlayerWeapon *)m_pEntity)->IsWeapon() ? true : false; } + virtual void Holster(int skiplocal) { ((CBasePlayerWeapon *)m_pEntity)->Holster(skiplocal); } + virtual void UpdateItemInfo() { ((CBasePlayerWeapon *)m_pEntity)->UpdateItemInfo(); } + virtual void ItemPostFrame() { ((CBasePlayerWeapon *)m_pEntity)->ItemPostFrame(); } + virtual int PrimaryAmmoIndex() { return ((CBasePlayerWeapon *)m_pEntity)->PrimaryAmmoIndex(); } + virtual int SecondaryAmmoIndex() { return ((CBasePlayerWeapon *)m_pEntity)->SecondaryAmmoIndex(); } + virtual int UpdateClientData(CCSPlayer *pPlayer) { return ((CBasePlayerWeapon *)m_pEntity)->UpdateClientData((CBasePlayer *)pPlayer->m_pEntity); } + virtual ICSPlayerItem *GetWeaponPtr() { return (ICSPlayerItem *)CBASE_TO_CSENTITY(((CBasePlayerWeapon *)m_pEntity)->GetWeaponPtr()); } + virtual int ExtractAmmo(CCSPlayerWeapon *pWeapon) { return ((CBasePlayerWeapon *)m_pEntity)->ExtractAmmo((CBasePlayerWeapon *)pWeapon->m_pEntity); } + virtual int ExtractClipAmmo(CCSPlayerWeapon *pWeapon) { return ((CBasePlayerWeapon *)m_pEntity)->ExtractClipAmmo((CBasePlayerWeapon *)pWeapon->m_pEntity); } + virtual int AddWeapon() { return ((CBasePlayerWeapon *)m_pEntity)->AddWeapon(); } + virtual bool PlayEmptySound() { return ((CBasePlayerWeapon *)m_pEntity)->PlayEmptySound() ? true : false; } + virtual void ResetEmptySound() { ((CBasePlayerWeapon *)m_pEntity)->ResetEmptySound(); } + virtual void SendWeaponAnim(int iAnim, int skiplocal) { ((CBasePlayerWeapon *)m_pEntity)->SendWeaponAnim(iAnim, skiplocal); } + virtual bool IsUseable() { return ((CBasePlayerWeapon *)m_pEntity)->IsUseable() ? true : false; } + virtual void PrimaryAttack() { ((CBasePlayerWeapon *)m_pEntity)->PrimaryAttack(); } + virtual void SecondaryAttack() { ((CBasePlayerWeapon *)m_pEntity)->SecondaryAttack(); } + virtual void Reload() { ((CBasePlayerWeapon *)m_pEntity)->Reload(); } + virtual void WeaponIdle() { ((CBasePlayerWeapon *)m_pEntity)->WeaponIdle(); } + virtual void RetireWeapon() { ((CBasePlayerWeapon *)m_pEntity)->RetireWeapon(); } + virtual bool ShouldWeaponIdle() { return ((CBasePlayerWeapon *)m_pEntity)->ShouldWeaponIdle() ? true : false; } + virtual bool UseDecrement() { return ((CBasePlayerWeapon *)m_pEntity)->UseDecrement() ? true : false; } +}; + +class CCSWorld: public CCSEntity +{ +public: + CCSWorld(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } +}; + +class CCSGrenade: public CCSMonster { +public: + CCSGrenade(CBaseEntity *pEntity) : CCSMonster(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Killed(entvars_t *pevAttacker, int iGib) { m_pEntity->Killed(pevAttacker, iGib); } + virtual int BloodColor() { return m_pEntity->BloodColor(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } + virtual void BounceSound() { ((CGrenade *)m_pEntity)->BounceSound(); } +}; + +class CCSAirtank: public CCSGrenade { +public: + CCSAirtank(CBaseEntity *pEntity) : CCSGrenade(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Killed(entvars_t *pevAttacker, int iGib) { m_pEntity->Killed(pevAttacker, iGib); } + virtual int BloodColor() { return m_pEntity->BloodColor(); } +}; + +class CCSPlayerAmmo: public CCSEntity { +public: + CCSPlayerAmmo(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((CBasePlayerAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } + virtual ICSEntity *Respawn() { return CBASE_TO_CSENTITY(m_pEntity->Respawn()); } +}; + +class CCS9MMAmmo: public CCSPlayerAmmo { +public: + CCS9MMAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C9MMAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCSBuckShotAmmo: public CCSPlayerAmmo { +public: + CCSBuckShotAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((CBuckShotAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS556NatoAmmo: public CCSPlayerAmmo { +public: + CCS556NatoAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C556NatoAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS556NatoBoxAmmo: public CCSPlayerAmmo { +public: + CCS556NatoBoxAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C556NatoBoxAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS762NatoAmmo: public CCSPlayerAmmo { +public: + CCS762NatoAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C762NatoAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS45ACPAmmo: public CCSPlayerAmmo { +public: + CCS45ACPAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C45ACPAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS50AEAmmo: public CCSPlayerAmmo { +public: + CCS50AEAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C50AEAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS338MagnumAmmo: public CCSPlayerAmmo { +public: + CCS338MagnumAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C338MagnumAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS57MMAmmo: public CCSPlayerAmmo { +public: + CCS57MMAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C57MMAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCS357SIGAmmo: public CCSPlayerAmmo { +public: + CCS357SIGAmmo(CBaseEntity *pEntity) : CCSPlayerAmmo(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool AddAmmo(CCSEntity *pOther) { return ((C357SIGAmmo *)m_pEntity)->AddAmmo(pOther->m_pEntity) ? true : false; } +}; + +class CCSFuncWall: public CCSEntity { +public: + CCSFuncWall(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFuncWallToggle: public CCSFuncWall { +public: + CCSFuncWallToggle(CBaseEntity *pEntity) : CCSFuncWall(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFuncConveyor: public CCSFuncWall { +public: + CCSFuncConveyor(CBaseEntity *pEntity) : CCSFuncWall(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFuncIllusionary: public CCSToggle { +public: + CCSFuncIllusionary(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } +}; + +class CCSFuncMonsterClip: public CCSFuncWall { +public: + CCSFuncMonsterClip(CBaseEntity *pEntity) : CCSFuncWall(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFuncRotating: public CCSEntity { +public: + CCSFuncRotating(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Blocked(CCSEntity *pOther) { m_pEntity->Blocked(pOther->m_pEntity); } +}; + +class CCSPendulum: public CCSEntity { +public: + CCSPendulum(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Touch(CCSEntity *pOther) { m_pEntity->Touch(pOther->m_pEntity); } + virtual void Blocked(CCSEntity *pOther) { m_pEntity->Blocked(pOther->m_pEntity); } +}; + +class CCSPointEntity: public CCSEntity { +public: + CCSPointEntity(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } +}; + +class CCSEnvGlobal: public CCSPointEntity { +public: + CCSEnvGlobal(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSMultiSource: public CCSPointEntity { +public: + CCSMultiSource(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual bool IsTriggered(CCSEntity *pActivator) { return m_pEntity->IsTriggered(pActivator->m_pEntity) ? true : false; } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSButton: public CCSToggle { +public: + CCSButton(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } +}; + +class CCSRotButton: public CCSButton { +public: + CCSRotButton(CBaseEntity *pEntity) : CCSButton(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } +}; + +class CCSMomentaryRotButton: public CCSToggle { +public: + CCSMomentaryRotButton(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSEnvSpark: public CCSEntity { +public: + CCSEnvSpark(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } +}; + +class CCSButtonTarget: public CCSEntity { +public: + CCSButtonTarget(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSDoor: public CCSToggle { +public: + CCSDoor(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual void KeyValue(KeyValueData *pkvd) { return m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void SetToggleState(int state) { m_pEntity->SetToggleState(state); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } + virtual void Blocked(CCSEntity *pOther) { m_pEntity->Blocked(pOther->m_pEntity); } +}; + +class CCSRotDoor: public CCSDoor { +public: + CCSRotDoor(CBaseEntity *pEntity) : CCSDoor(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual void SetToggleState(int state) { m_pEntity->SetToggleState(state); } +}; + +class CCSMomentaryDoor: public CCSToggle { +public: + CCSMomentaryDoor(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { return m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSGib: public CCSEntity { +public: + CCSGib(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } +}; + +class CCSBubbling: public CCSEntity { +public: + CCSBubbling(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSBeam: public CCSEntity { +public: + CCSBeam(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual Vector Center() { return m_pEntity->Center(); } +}; + +class CCSLightning: public CCSBeam { +public: + CCSLightning(CBaseEntity *pEntity) : CCSBeam(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Activate() { m_pEntity->Activate(); } +}; + +class CCSLaser: public CCSBeam { +public: + CCSLaser(CBaseEntity *pEntity) : CCSBeam(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSGlow: public CCSPointEntity { +public: + CCSGlow(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Think() { m_pEntity->Think(); } +}; + +class CCSSprite: public CCSPointEntity { +public: + CCSSprite(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSBombGlow: public CCSSprite { +public: + CCSBombGlow(CBaseEntity *pEntity) : CCSSprite(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Think() { m_pEntity->Think(); } +}; + +class CCSGibShooter: public CCSDelay { +public: + CCSGibShooter(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } + virtual ICSGib *CreateGib() { CBASE_TO_CSENTITY(((CGibShooter *)m_pEntity)->CreateGib()); } +}; + +class CCSEnvShooter: public CCSGibShooter { +public: + CCSEnvShooter(CBaseEntity *pEntity) : CCSGibShooter(pEntity) {} +public: + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual ICSGib *CreateGib() { CBASE_TO_CSENTITY(((CEnvShooter *)m_pEntity)->CreateGib()); } +}; + +class CCSTestEffect: public CCSDelay { +public: + CCSTestEffect(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSBlood: public CCSPointEntity { +public: + CCSBlood(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSShake: public CCSPointEntity { +public: + CCSShake(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFade: public CCSPointEntity { +public: + CCSFade(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSMessage: public CCSPointEntity { +public: + CCSMessage(CBaseEntity *pEntity) : CCSPointEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSEnvFunnel: public CCSDelay { +public: + CCSEnvFunnel(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSEnvBeverage: public CCSDelay { +public: + CCSEnvBeverage(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSItemSoda: public CCSEntity { +public: + CCSItemSoda(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } +}; + +class CCSShower: public CCSEntity { +public: + CCSShower(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Think() { m_pEntity->Think(); } + virtual void Touch(CCSEntity *pOther) { m_pEntity->Touch(pOther->m_pEntity); } +}; + +class CCSEnvExplosion: public CCSMonster { +public: + CCSEnvExplosion(CBaseEntity *pEntity) : CCSMonster(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSBreakable: public CCSDelay { +public: + CCSBreakable(CBaseEntity *pEntity) : CCSDelay(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir, TraceResult *ptr, int bitsDamageType) { m_pEntity->TraceAttack(pevAttacker, flDamage, vecDir, ptr, bitsDamageType); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual int DamageDecal(int bitsDamageType) { return m_pEntity->DamageDecal(bitsDamageType); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSPushable: public CCSBreakable { +public: + CCSPushable(CBaseEntity *pEntity) : CCSBreakable(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual void Touch(CCSEntity *pOther) { m_pEntity->Touch(pOther->m_pEntity); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSFuncTank: public CCSEntity { +public: + CCSFuncTank(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual bool OnControls(entvars_t *pevTest) { return m_pEntity->OnControls(pevTest) ? true : false; } + virtual void Think() { m_pEntity->Think(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } + virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { ((CFuncTank *)m_pEntity)->Fire(barrelEnd, forward, pevAttacker); } + virtual Vector UpdateTargetPosition(CCSEntity *pTarget) { return ((CFuncTank *)m_pEntity)->UpdateTargetPosition(pTarget->m_pEntity); } +}; + +class CCSFuncTankGun: public CCSFuncTank { +public: + CCSFuncTankGun(CBaseEntity *pEntity) : CCSFuncTank(pEntity) {} +public: + virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { ((CFuncTankGun *)m_pEntity)->Fire(barrelEnd, forward, pevAttacker); } +}; + +class CCSFuncTankLaser: public CCSFuncTank { +public: + CCSFuncTankLaser(CBaseEntity *pEntity) : CCSFuncTank(pEntity) {} +public: + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Activate() { m_pEntity->Activate(); } + virtual void Think() { m_pEntity->Think(); } + virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { ((CFuncTankLaser *)m_pEntity)->Fire(barrelEnd, forward, pevAttacker); } +}; + +class CCSFuncTankRocket: public CCSFuncTank { +public: + CCSFuncTankRocket(CBaseEntity *pEntity) : CCSFuncTank(pEntity) {} +public: + virtual void Precache() { m_pEntity->Precache(); } + virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { ((CFuncTankRocket *)m_pEntity)->Fire(barrelEnd, forward, pevAttacker); } +}; + +class CCSFuncTankMortar: public CCSFuncTank { +public: + CCSFuncTankMortar(CBaseEntity *pEntity) : CCSFuncTank(pEntity) {} +public: + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual void Fire(const Vector &barrelEnd, const Vector &forward, entvars_t *pevAttacker) { ((CFuncTankMortar *)m_pEntity)->Fire(barrelEnd, forward, pevAttacker); } +}; + +class CCSFuncTankControls: public CCSEntity { +public: + CCSFuncTankControls(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Think() { m_pEntity->Think(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + + + + + + +class CCSRecharge: public CCSToggle { +public: + CCSRecharge(CBaseEntity *pEntity) : CCSToggle(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSCycler: public CCSMonster { +public: + CCSCycler(CBaseEntity *pEntity) : CCSMonster(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual bool IsAlive() { return m_pEntity->IsAlive() ? true : false; } + virtual void Think() { m_pEntity->Think(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSGenericCycler: public CCSCycler { +public: + CCSGenericCycler(CBaseEntity *pEntity) : CCSCycler(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } +}; + +class CCSCyclerProbe: public CCSCycler { +public: + CCSCyclerProbe(CBaseEntity *pEntity) : CCSCycler(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } +}; + +class CCSCyclerSprite: public CCSEntity { +public: + CCSCyclerSprite(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Restart() { m_pEntity->Restart(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual int ObjectCaps() { return m_pEntity->ObjectCaps(); } + virtual int TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) { return m_pEntity->TakeDamage(pevInflictor, pevAttacker, flDamage, bitsDamageType); } + virtual void Think() { m_pEntity->Think(); } + virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) { m_pEntity->Use(pActivator->m_pEntity, pCaller->m_pEntity, useType, value); } +}; + +class CCSWeaponCycler: public CCSPlayerWeapon { +public: + CCSWeaponCycler(CBaseEntity *pEntity) : CCSPlayerWeapon(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual int GetItemInfo(ItemInfo *p) { return ((CWeaponCycler *)m_pEntity)->GetItemInfo(p); } + virtual bool Deploy() { return ((CWeaponCycler *)m_pEntity)->Deploy() ? true : false; } + virtual void Holster(int skiplocal) { ((CWeaponCycler *)m_pEntity)->Holster(skiplocal); } + virtual int iItemSlot() { return ((CWeaponCycler *)m_pEntity)->iItemSlot(); } + virtual void PrimaryAttack() { ((CWeaponCycler *)m_pEntity)->PrimaryAttack(); } + virtual void SecondaryAttack() { ((CWeaponCycler *)m_pEntity)->SecondaryAttack(); } +}; + +class CCSWreckage: public CCSMonster { +public: + CCSWreckage(CBaseEntity *pEntity) : CCSMonster(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual int Save(CSave &save) { return m_pEntity->Save(save); } + virtual int Restore(CRestore &restore) { return m_pEntity->Restore(restore); } + virtual void Think() { m_pEntity->Think(); } +}; + +class CCSWorldItem: public CCSEntity { +public: + CCSWorldItem(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void KeyValue(KeyValueData *pkvd) { m_pEntity->KeyValue(pkvd); } +}; + +class CCSItem: public CCSEntity { +public: + CCSItem(CBaseEntity *pEntity) : CCSEntity(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual ICSEntity *Respawn() { return CBASE_TO_CSENTITY(m_pEntity->Respawn()); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItem *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSHealthKit: public CCSItem { +public: + CCSHealthKit(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CHealthKit *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemSuit: public CCSItem { +public: + CCSItemSuit(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemSuit *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemBattery: public CCSItem { +public: + CCSItemBattery(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemBattery *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemAntidote: public CCSItem { +public: + CCSItemAntidote(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemAntidote *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemSecurity: public CCSItem { +public: + CCSItemSecurity(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemSecurity *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemLongJump: public CCSItem { +public: + CCSItemLongJump(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemLongJump *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemKevlar: public CCSItem { +public: + CCSItemKevlar(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemKevlar *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemAssaultSuit: public CCSItem { +public: + CCSItemAssaultSuit(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemAssaultSuit *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + +class CCSItemThighPack: public CCSItem { +public: + CCSItemThighPack(CBaseEntity *pEntity) : CCSItem(pEntity) {} +public: + virtual void Spawn() { m_pEntity->Spawn(); } + virtual void Precache() { m_pEntity->Precache(); } + virtual bool MyTouch(CCSPlayer *pPlayer) { return ((CItemThighPack *)m_pEntity)->MyTouch((CBasePlayer *)pPlayer->m_pEntity) ? true : false; } +}; + + + + +inline CCSPlayer *CSPlayer(int iPlayerNum) { return reinterpret_cast(g_GameEntities[iPlayerNum]); } +inline CCSPlayer *CSPlayer(const edict_t *pEdict) { return CSPlayer(ENTINDEX(pEdict)); } +inline CCSPlayer *CSPlayer(CBaseEntity *pEntity) { return CSPlayer(pEntity->entindex()); } + +inline CCSEntity *CSEntity(int iEntityNum) { return reinterpret_cast(g_GameEntities[iEntityNum]); } +inline CCSEntity *CSEntity(const edict_t *pEdict) { return CSEntity(ENTINDEX(pEdict)); } +inline CCSEntity *CSEntity(CBaseEntity *pEntity) { return CSEntity(pEntity->entindex()); } + +extern void Regamedll_AllocEntities(int maxEdicts); +extern void Regamedll_FreeEntities(CBaseEntity *pEntity = NULL); +extern void Regamedll_MonitorEntities();