From df8cab66f487a3ad78497c4c2530df6b06102846 Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 21 Apr 2016 06:50:13 +0600 Subject: [PATCH] Added members CBaseEntity, CBaseAnimating Implemented functions CBasePlayer::SetAnimation, CBasePlayer::GiveDefaultItems, CBasePlayer::GiveNamedItem, CBasePlayer::AddAccount, CBasePlayer::GiveShield, CBaseAnimating::ResetSequenceInfo, PlayerBlind, RadiusFlash_TraceLine, FireBullets, FireBullets3, RadiusDamage, ClearMultiDamage, ApplyMultiDamage, AddMultiDamage Added misc natives --- .../extra/amxmodx/scripting/include/reapi.inc | 6 - .../amxmodx/scripting/include/reapi_const.inc | 2 +- .../scripting/include/reapi_gamedll.inc | 13 + .../scripting/include/reapi_gamedll_const.inc | 325 +++++++++++++- reapi/include/cssdk/dlls/gamerules.h | 2 - reapi/include/cssdk/dlls/osconfig.h | 5 + reapi/include/cssdk/dlls/regamedll_api.h | 78 +++- .../include/cssdk/dlls/regamedll_interfaces.h | 410 +++++++++--------- .../{hookchains_.h => hookchains_rehlds.h} | 0 reapi/include/cssdk/public/interface.h | 2 +- reapi/msvc/reapi.vcxproj | 2 + reapi/msvc/reapi.vcxproj.filters | 17 +- reapi/src/amxxmodule.cpp | 2 + reapi/src/amxxmodule.h | 2 +- reapi/src/api_config.cpp | 14 + reapi/src/api_config.h | 3 + reapi/src/dllapi.cpp | 6 +- reapi/src/hook_callback.cpp | 84 ++++ reapi/src/hook_callback.h | 26 +- reapi/src/hook_list.cpp | 19 +- reapi/src/hook_list.h | 60 ++- reapi/src/hook_manager.cpp | 17 +- reapi/src/hook_manager.h | 13 +- reapi/src/main.cpp | 10 +- reapi/src/member_list.cpp | 87 ++-- reapi/src/member_list.h | 42 ++ reapi/src/meta_api.cpp | 4 +- reapi/src/mod_regamedll_api.cpp | 1 - reapi/src/natives_hookchains.cpp | 18 +- reapi/src/natives_members.cpp | 53 +-- reapi/src/natives_misc.cpp | 189 ++++++++ reapi/src/natives_misc.h | 3 + reapi/src/precompiled.h | 1 + reapi/src/reapi_const.inc | 2 +- 34 files changed, 1172 insertions(+), 346 deletions(-) rename reapi/include/cssdk/engine/{hookchains_.h => hookchains_rehlds.h} (100%) create mode 100644 reapi/src/natives_misc.cpp create mode 100644 reapi/src/natives_misc.h diff --git a/reapi/extra/amxmodx/scripting/include/reapi.inc b/reapi/extra/amxmodx/scripting/include/reapi.inc index 9679d9a..42175f2 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi.inc @@ -50,7 +50,6 @@ enum HookChain * @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. * */ - native HookChain:RegisterHookChain(any:function_id, const callback[], post = 0); /* @@ -60,7 +59,6 @@ native HookChain:RegisterHookChain(any:function_id, const callback[], post = 0); * @param hook The hook to stop. * */ - native bool:DisableHookChain(HookChain:hook); /* @@ -71,7 +69,6 @@ native bool:DisableHookChain(HookChain:hook); * @return Returns if the function is successful executed true otherwise false * */ - native bool:EnableHookChain(HookChain:hook); /* @@ -83,7 +80,6 @@ native bool:EnableHookChain(HookChain:hook); * * native SetHookChainReturn(AType:type, any:...); */ - native SetHookChainReturn(HookChainReturn:type, any:...); /* @@ -95,7 +91,6 @@ native SetHookChainReturn(HookChainReturn:type, any:...); * * native GetHookChainReturn(AType:type, any:...); */ - native GetHookChainReturn(AType:type, any:...); /* @@ -109,7 +104,6 @@ native GetHookChainReturn(AType:type, any:...); * * native SetHookChainArg(number, AType:type, any:...); */ - native SetHookChainArg(number, AType:type, any:...); /* diff --git a/reapi/extra/amxmodx/scripting/include/reapi_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_const.inc index 16c7a3b..123a80b 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_const.inc @@ -4,5 +4,5 @@ #define _reapi_const_included // reapi version -#define REAPI_VERISON_MAJOR 1 +#define REAPI_VERISON_MAJOR 2 #define REAPI_VERISON_MINOR 0 diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc index c355d2d..df1bb13 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll.inc @@ -52,3 +52,16 @@ native set_member(index, any:member, any:...); * */ native any:get_member(index, any:member, any:...); + +native rg_set_animation(index, PLAYER_ANIM:playerAnim); +native rg_add_account(index, amount, bool:bTrackChange = true); +native rg_give_item(index, const pszName[]); +native rg_give_default_items(index); +native rg_give_shield(index, bool:bDeploy = true); +native rg_dmg_radius(Float:vecSrc[3], inflictor, attacker, Float:flDamage, Float:flRadius, iClassIgnore, bitsDamageType); +native rg_multidmg_clear(); +native rg_multidmg_apply(inflictor, attacker); +native rg_multidmg_add(inflictor, victim, Float:flDamage, bitsDamageType); + +native rg_fire_bullets(inflictor, attacker, shots, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread[3], Float:flDistance, iBulletType, iTracerFreq, iDamage); +native Float:[3] rg_fire_bullets3(inflictor, attacker, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread, Float:flDistance, iPenetration, iBulletType, iDamage, Float:flRangeModifier, bool:bPistol, shared_rand); diff --git a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc index 77cca3c..7fff0e9 100644 --- a/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc +++ b/reapi/extra/amxmodx/scripting/include/reapi_gamedll_const.inc @@ -11,6 +11,21 @@ #define SIGNAL_ESCAPE (1<<3) #define SIGNAL_VIPSAFETY (1<<4) +enum PLAYER_ANIM +{ + PLAYER_IDLE, + PLAYER_WALK, + PLAYER_JUMP, + PLAYER_SUPERJUMP, + PLAYER_DIE, + PLAYER_ATTACK1, + PLAYER_ATTACK2, + PLAYER_FLINCH, + PLAYER_LARGE_FLINCH, + PLAYER_RELOAD, + PLAYER_HOLDBOMB +}; + enum GamedllFunc { /** @@ -20,17 +35,41 @@ enum GamedllFunc */ RH_GetForceCamera = 1024, + /** + * Description: - + * Params: (const index, const inflictor, const attacker, const Float:fadeTime, const Float:fadeHold, const alpha, Float:color[3]) + */ + RH_PlayerBlind, + + /** + * Description: - + * Params: (const index, inflictor, attacker, Float:vecSrc[3], Float:vecSpot[3], tracehandle) + */ + RH_RadiusFlash_TraceLine, + // [...] RH_GameDLL_End }; +enum GamedllFunc_CBaseAnimating +{ + /** + * Description: - + * Params: (const this) + */ + RH_CBaseAnimating_ResetSequenceInfo = 2048, + + // [...] + RH_CBaseAnimating_End +}; + enum GamedllFunc_CBasePlayer { /** * Description: - * Params: (const this) */ - RH_CBasePlayer_Spawn = 2048, + RH_CBasePlayer_Spawn = 3072, /** * Description: - @@ -820,6 +859,254 @@ enum CSGameRules_Members m_bSkipSpawn }; +// CBaseEntity +enum CBaseEntity_Members +{ + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + currentammo = 1024, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_buckshot, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_buckshot, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_9mm, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_9mm, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_556nato, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_556nato, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_556natobox, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_556natobox, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_762nato, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_762nato, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_45acp, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_45acp, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_50ae, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_50ae, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_338mag, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_338mag, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_57mm, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_57mm, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + maxammo_357sig, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + ammo_357sig, + + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flStartThrow, + + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flReleaseThrow, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + m_iSwing, + + /** + * Description: - + * Member type: bool + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + has_disconnected, +}; + +// CBaseAnimating +enum CBaseAnimating_Members +{ + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flFrameRate = 2048, + + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flGroundSpeed, + + /** + * Description: - + * Member type: float + * Get params: Float:get_member(index, member); + * Set params: set_member(index, member, Float:value); + */ + m_flLastEventCheck, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + m_fSequenceFinished, + + /** + * Description: - + * Member type: int + * Get params: get_member(index, member); + * Set params: set_member(index, member, value); + */ + m_fSequenceLoops, +}; + // CBasePlayer enum CBasePlayer_Members { @@ -829,7 +1116,7 @@ enum CBasePlayer_Members * Get params: get_member(index, member); * Set params: set_member(index, member, value); */ - random_seed = 1024, + random_seed = 3072, /** * Description: - @@ -1370,8 +1657,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [32] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_szNewName, @@ -1394,7 +1681,7 @@ enum CBasePlayer_Members /** * Description: - * Member type: class CUnifiedSignals - * Get params: get_member(index, member, &signal, &state); + * Get params: get_member(index, member, signals[2]); (0 - signal, 1 - state) * Set params: set_member(index, member, value); */ m_signals, @@ -1690,8 +1977,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [17] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_szTextureName, @@ -1970,8 +2257,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [128] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_SbarString0, @@ -2010,8 +2297,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [16] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_szTeamName, @@ -2026,8 +2313,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [32] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_szAnimExtention, @@ -2202,16 +2489,16 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [256] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_autoBuyString, /** * Description: - * Member type: char * - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_rebuyString, @@ -2242,8 +2529,8 @@ enum CBasePlayer_Members /** * Description: - * Member type: char [32] - * Get params: Float:get_member(index, member, const dest[], const lenght); - * Set params: set_member(index, member, const dest[]); + * Get params: get_member(index, member, dest[], const lenght); + * Set params: set_member(index, member, const source[]); */ m_lastLocation, diff --git a/reapi/include/cssdk/dlls/gamerules.h b/reapi/include/cssdk/dlls/gamerules.h index 114641c..c4914fd 100644 --- a/reapi/include/cssdk/dlls/gamerules.h +++ b/reapi/include/cssdk/dlls/gamerules.h @@ -29,8 +29,6 @@ #include "voice_gamemgr.h" -#define COM_TOKEN_LEN 1500 - #define MAX_RULE_BUFFER 1024 #define MAX_VOTE_MAPS 100 #define MAX_VIP_QUEUES 5 diff --git a/reapi/include/cssdk/dlls/osconfig.h b/reapi/include/cssdk/dlls/osconfig.h index b92c99b..1d956a6 100644 --- a/reapi/include/cssdk/dlls/osconfig.h +++ b/reapi/include/cssdk/dlls/osconfig.h @@ -151,6 +151,11 @@ // It's usually defined to something like "__stdcall". #else // _WIN32 + #ifdef __FUNCTION__ + #undef __FUNCTION__ + #endif + #define __FUNCTION__ __func__ + #ifndef PAGESIZE #define PAGESIZE 4096 #endif diff --git a/reapi/include/cssdk/dlls/regamedll_api.h b/reapi/include/cssdk/dlls/regamedll_api.h index 18a01bc..ef3a47d 100644 --- a/reapi/include/cssdk/dlls/regamedll_api.h +++ b/reapi/include/cssdk/dlls/regamedll_api.h @@ -51,8 +51,8 @@ typedef IHookChain IReGameHook_CBasePlayer_Classify; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Classify; // CBasePlayer::TraceAttack hook -typedef IVoidHookChain IReGameHook_CBasePlayer_TraceAttack; -typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; +typedef IVoidHookChain IReGameHook_CBasePlayer_TraceAttack; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_TraceAttack; // CBasePlayer::TakeDamage hook typedef IHookChain IReGameHook_CBasePlayer_TakeDamage; @@ -123,20 +123,53 @@ typedef IVoidHookChain IReGameHook_CBasePlayer_Blind; typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Blind; - - - - - - -// Observer_IsValidTarget hook +// CBasePlayer::Observer_IsValidTarget hook typedef IHookChain IReGameHook_CBasePlayer_Observer_IsValidTarget; typedef IHookChainRegistryClass IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget; +// CBasePlayer::SetAnimation hook +typedef IVoidHookChain IReGameHook_CBasePlayer_SetAnimation; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_SetAnimation; + +// CBasePlayer::GiveDefaultItems hook +typedef IVoidHookChain<> IReGameHook_CBasePlayer_GiveDefaultItems; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveDefaultItems; + +// CBasePlayer::GiveNamedItem hook +typedef IVoidHookChain IReGameHook_CBasePlayer_GiveNamedItem; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveNamedItem; + +// CBasePlayer::AddAccount hook +typedef IVoidHookChain IReGameHook_CBasePlayer_AddAccount; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_AddAccount; + +// CBasePlayer::GiveShield hook +typedef IVoidHookChain IReGameHook_CBasePlayer_GiveShield; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBasePlayer_GiveShield; + + + + +// CBaseAnimating::ResetSequenceInfo hook +typedef IVoidHookChain<> IReGameHook_CBaseAnimating_ResetSequenceInfo; +typedef IVoidHookChainRegistryClass IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo; + + + + + // GetForceCamera hook typedef IHookChain IReGameHook_GetForceCamera; typedef IHookChainRegistry IReGameHookRegistry_GetForceCamera; +// PlayerBlind hook +typedef IVoidHookChain IReGameHook_PlayerBlind; +typedef IVoidHookChainRegistry IReGameHookRegistry_PlayerBlind; + +// RadiusFlash_TraceLine hook +typedef IVoidHookChain IReGameHook_RadiusFlash_TraceLine; +typedef IVoidHookChainRegistry IReGameHookRegistry_RadiusFlash_TraceLine; + class IReGameHookchains { public: virtual ~IReGameHookchains() {} @@ -164,23 +197,38 @@ public: virtual IReGameHookRegistry_CBasePlayer_RoundRespawn* CBasePlayer_RoundRespawn() = 0; virtual IReGameHookRegistry_CBasePlayer_Blind* CBasePlayer_Blind() = 0; - - - - - virtual IReGameHookRegistry_CBasePlayer_Observer_IsValidTarget* CBasePlayer_Observer_IsValidTarget() = 0; + virtual IReGameHookRegistry_CBasePlayer_SetAnimation* CBasePlayer_SetAnimation() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveDefaultItems* CBasePlayer_GiveDefaultItems() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveNamedItem* CBasePlayer_GiveNamedItem() = 0; + virtual IReGameHookRegistry_CBasePlayer_AddAccount* CBasePlayer_AddAccount() = 0; + virtual IReGameHookRegistry_CBasePlayer_GiveShield* CBasePlayer_GiveShield() = 0; + + + virtual IReGameHookRegistry_CBaseAnimating_ResetSequenceInfo* CBaseAnimating_ResetSequenceInfo() = 0; + + virtual IReGameHookRegistry_GetForceCamera* GetForceCamera() = 0; + virtual IReGameHookRegistry_PlayerBlind* PlayerBlind() = 0; + virtual IReGameHookRegistry_RadiusFlash_TraceLine* RadiusFlash_TraceLine() = 0; }; struct ReGameFuncs_t { class CBaseEntity *(*UTIL_PlayerByIndex)(int playerIndex); class ICSPlayer *(*CBASE_TO_CSPLAYER)(class CBaseEntity *pEntity); - class ICSEntity *(*CBASE_TO_CSENTITY)(CBaseEntity *pEntity); + class ICSEntity *(*CBASE_TO_CSENTITY)(class CBaseEntity *pEntity); class ICSPlayer *(*INDEX_TO_CSPLAYER)(int iPlayerIndex); class ICSEntity *(*INDEX_TO_CSENTITY)(int iEntityIndex); struct edict_s *(*CREATE_NAMED_ENTITY2)(string_t iClass); + + void (*ChangeString)(char *&dest, const char *source); + + void (*RadiusDamage)(Vector vecSrc, entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, float flRadius, int iClassIgnore, int bitsDamageType); + void (*ClearMultiDamage)(); + void (*ApplyMultiDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker); + void (*AddMultiDamage)(entvars_t *pevInflictor, CBaseEntity *pEntity, float flDamage, int bitsDamageType); + }; class IReGameApi { diff --git a/reapi/include/cssdk/dlls/regamedll_interfaces.h b/reapi/include/cssdk/dlls/regamedll_interfaces.h index f3a5c08..6c411cd 100644 --- a/reapi/include/cssdk/dlls/regamedll_interfaces.h +++ b/reapi/include/cssdk/dlls/regamedll_interfaces.h @@ -118,23 +118,25 @@ public: public: virtual struct entvars_s *GetEntVars() const = 0; virtual class CBaseEntity *GetEntity() const = 0; + virtual void FireBullets(int iShots, Vector vecSrc, Vector vecDirShooting, Vector vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker) = 0; + virtual Vector FireBullets3(Vector vecSrc, Vector vecDirShooting, float vecSpread, float flDistance, int iPenetration, int iBulletType, int iDamage, float flRangeModifier, entvars_t *pevAttacker, bool bPistol, int shared_rand) = 0; }; -class ICSDelay: public virtual ICSEntity { +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 virtual ICSDelay { +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 virtual ICSAnimating { +class ICSPlayerItem: public ICSAnimating { public: virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; @@ -163,7 +165,7 @@ public: virtual int iItemSlot() = 0; }; -class ICSPlayerWeapon: public virtual ICSPlayerItem { +class ICSPlayerWeapon: public ICSPlayerItem { public: virtual int Save(CSave &save) = 0; virtual int Restore(CRestore &restore) = 0; @@ -194,7 +196,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSToggle: public virtual ICSAnimating { +class ICSToggle: public ICSAnimating { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -203,7 +205,7 @@ public: virtual float GetDelay() = 0; }; -class ICSMonster: public virtual ICSToggle { +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; @@ -231,7 +233,7 @@ public: virtual bool FInViewCone(const Vector *pOrigin) = 0; }; -class ICSWeaponBox: public virtual ICSEntity { +class ICSWeaponBox: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -242,7 +244,7 @@ public: virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSArmoury: public virtual ICSEntity { +class ICSArmoury: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -250,7 +252,7 @@ public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSPlayer: public virtual ICSMonster { +class ICSPlayer: public ICSMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -293,9 +295,15 @@ public: virtual void OnTouchingWeapon(CCSWeaponBox *pWeapon) = 0; public: virtual bool IsConnected() const = 0; + + virtual void SetAnimation(PLAYER_ANIM playerAnim) = 0; + virtual void AddAccount(int amount, bool bTrackChange = true) = 0; + virtual void GiveNamedItem(const char *pszName) = 0; + virtual void GiveDefaultItems() = 0; + virtual void GiveShield(bool bDeploy = true) = 0; }; -class IAPI_Bot: public virtual ICSPlayer { +class IAPI_Bot: public ICSPlayer { public: virtual void Spawn() = 0; virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0; @@ -334,7 +342,7 @@ public: virtual void SetModel(const char *modelName) = 0; }; -class IAPI_CSBot: public virtual IAPI_Bot { +class IAPI_CSBot: public IAPI_Bot { public: virtual int TakeDamage(struct entvars_s *pevInflictor, struct entvars_s *pevAttacker, float flDamage, int bitsDamageType) = 0; virtual void Killed(struct entvars_s *pevAttacker, int iGib) = 0; @@ -353,48 +361,48 @@ public: virtual bool IsEnemyPartVisible(VisiblePartTypeBot part) const = 0; }; -class ICSShield: public virtual ICSEntity { +class ICSShield: public ICSEntity { public: virtual void Spawn() = 0; virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSDeadHEV: public virtual ICSMonster { +class ICSDeadHEV: public ICSMonster { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Classify() = 0; }; -class ICSSprayCan: public virtual ICSEntity { +class ICSSprayCan: public ICSEntity { public: virtual void Think() = 0; virtual int ObjectCaps() = 0; }; -class ICSBloodSplat: public virtual ICSEntity { +class ICSBloodSplat: public ICSEntity { public: }; -class ICSWorld: public virtual ICSEntity { +class ICSWorld: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSDecal: public virtual ICSEntity { +class ICSDecal: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSCorpse: public virtual ICSEntity { +class ICSCorpse: public ICSEntity { public: virtual int ObjectCaps() = 0; }; -class ICSGrenade: public virtual ICSMonster { +class ICSGrenade: public ICSMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -406,7 +414,7 @@ public: virtual void BounceSound() = 0; }; -class ICSAirtank: public virtual ICSGrenade { +class ICSAirtank: public ICSGrenade { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -416,116 +424,116 @@ public: virtual int BloodColor() = 0; }; -class ICSPlayerAmmo: public virtual ICSEntity { +class ICSPlayerAmmo: public ICSEntity { public: virtual void Spawn() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; virtual ICSEntity *Respawn() = 0; }; -class ICS9MMAmmo: public virtual ICSPlayerAmmo { +class ICS9MMAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICSBuckShotAmmo: public virtual ICSPlayerAmmo { +class ICSBuckShotAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS556NatoAmmo: public virtual ICSPlayerAmmo { +class ICS556NatoAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS556NatoBoxAmmo: public virtual ICSPlayerAmmo { +class ICS556NatoBoxAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS762NatoAmmo: public virtual ICSPlayerAmmo { +class ICS762NatoAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS45ACPAmmo: public virtual ICSPlayerAmmo { +class ICS45ACPAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS50AEAmmo: public virtual ICSPlayerAmmo { +class ICS50AEAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS338MagnumAmmo: public virtual ICSPlayerAmmo { +class ICS338MagnumAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS57MMAmmo: public virtual ICSPlayerAmmo { +class ICS57MMAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICS357SIGAmmo: public virtual ICSPlayerAmmo { +class ICS357SIGAmmo: public ICSPlayerAmmo { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool AddAmmo(CCSEntity *pOther) = 0; }; -class ICSFuncWall: public virtual ICSEntity { +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 virtual ICSFuncWall { +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 virtual ICSFuncWall { +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 virtual ICSToggle { +class ICSFuncIllusionary: public ICSToggle { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int ObjectCaps() = 0; }; -class ICSFuncMonsterClip: public virtual ICSFuncWall { +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 virtual ICSEntity { +class ICSFuncRotating: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -536,7 +544,7 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSPendulum: public virtual ICSEntity { +class ICSPendulum: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -547,24 +555,24 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSPointEntity: public virtual ICSEntity { +class ICSPointEntity: public ICSEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; }; -class ICSStripWeapons: public virtual ICSPointEntity { +class ICSStripWeapons: public ICSPointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSInfoIntermission: public virtual ICSPointEntity { +class ICSInfoIntermission: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void Think() = 0; }; -class ICSRevertSaved: public virtual ICSPointEntity { +class ICSRevertSaved: public ICSPointEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -572,7 +580,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSEnvGlobal: public virtual ICSPointEntity { +class ICSEnvGlobal: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -581,7 +589,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSMultiSource: public virtual ICSPointEntity { +class ICSMultiSource: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -592,7 +600,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSButton: public virtual ICSToggle { +class ICSButton: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -603,12 +611,12 @@ public: virtual int ObjectCaps() = 0; }; -class ICSRotButton: public virtual ICSButton { +class ICSRotButton: public ICSButton { public: virtual void Spawn() = 0; }; -class ICSMomentaryRotButton: public virtual ICSToggle { +class ICSMomentaryRotButton: public ICSToggle { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -618,7 +626,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSEnvSpark: public virtual ICSEntity { +class ICSEnvSpark: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -627,7 +635,7 @@ public: virtual int Restore(CRestore &restore) = 0; }; -class ICSButtonTarget: public virtual ICSEntity { +class ICSButtonTarget: public ICSEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; @@ -635,7 +643,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSDoor: public virtual ICSToggle { +class ICSDoor: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -649,14 +657,14 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSRotDoor: public virtual ICSDoor { +class ICSRotDoor: public ICSDoor { public: virtual void Spawn() = 0; virtual void Restart() = 0; virtual void SetToggleState(int state) = 0; }; -class ICSMomentaryDoor: public virtual ICSToggle { +class ICSMomentaryDoor: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -667,12 +675,12 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGib: public virtual ICSEntity { +class ICSGib: public ICSEntity { public: virtual int ObjectCaps() = 0; }; -class ICSBubbling: public virtual ICSEntity { +class ICSBubbling: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -683,7 +691,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSBeam: public virtual ICSEntity { +class ICSBeam: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -691,7 +699,7 @@ public: virtual Vector Center() = 0; }; -class ICSLightning: public virtual ICSBeam { +class ICSLightning: public ICSBeam { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -701,7 +709,7 @@ public: virtual void Activate() = 0; }; -class ICSLaser: public virtual ICSBeam { +class ICSLaser: public ICSBeam { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -711,7 +719,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGlow: public virtual ICSPointEntity { +class ICSGlow: public ICSPointEntity { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -719,7 +727,7 @@ public: virtual void Think() = 0; }; -class ICSSprite: public virtual ICSPointEntity { +class ICSSprite: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -730,13 +738,13 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSBombGlow: public virtual ICSSprite { +class ICSBombGlow: public ICSSprite { public: virtual void Spawn() = 0; virtual void Think() = 0; }; -class ICSGibShooter: public virtual ICSDelay { +class ICSGibShooter: public ICSDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -747,7 +755,7 @@ public: virtual ICSGib *CreateGib() = 0; }; -class ICSEnvShooter: public virtual ICSGibShooter { +class ICSEnvShooter: public ICSGibShooter { public: virtual void Precache() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -755,28 +763,28 @@ public: }; -class ICSTestEffect: public virtual ICSDelay { +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 virtual ICSPointEntity { +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 virtual ICSPointEntity { +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 virtual ICSPointEntity { +class ICSFade: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -784,7 +792,7 @@ public: }; -class ICSMessage: public virtual ICSPointEntity { +class ICSMessage: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -792,27 +800,27 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSEnvFunnel: public virtual ICSDelay { +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 virtual ICSDelay { +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 virtual ICSEntity { +class ICSItemSoda: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; }; -class ICSShower: public virtual ICSEntity { +class ICSShower: public ICSEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; @@ -820,7 +828,7 @@ public: virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSEnvExplosion: public virtual ICSMonster { +class ICSEnvExplosion: public ICSMonster { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -829,7 +837,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSBreakable: public virtual ICSDelay { +class ICSBreakable: public ICSDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -844,7 +852,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSPushable: public virtual ICSBreakable { +class ICSPushable: public ICSBreakable { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -857,7 +865,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSFuncTank: public virtual ICSEntity { +class ICSFuncTank: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -872,12 +880,12 @@ public: virtual Vector UpdateTargetPosition(CCSEntity *pTarget) = 0; }; -class ICSFuncTankGun: public virtual ICSFuncTank { +class ICSFuncTankGun: public ICSFuncTank { public: virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0; }; -class ICSFuncTankLaser: public virtual ICSFuncTank { +class ICSFuncTankLaser: public ICSFuncTank { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -887,19 +895,19 @@ public: virtual void Fire(const Vector &barrelEnd, const Vector &forward, struct entvars_s *pevAttacker) = 0; }; -class ICSFuncTankRocket: public virtual ICSFuncTank { +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 virtual ICSFuncTank { +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 virtual ICSEntity { +class ICSFuncTankControls: public ICSEntity { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -909,7 +917,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSRecharge: public virtual ICSToggle { +class ICSRecharge: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -920,7 +928,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSCycler: public virtual ICSMonster { +class ICSCycler: public ICSMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -932,17 +940,17 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGenericCycler: public virtual ICSCycler { +class ICSGenericCycler: public ICSCycler { public: virtual void Spawn() = 0; }; -class ICSCyclerProbe: public virtual ICSCycler { +class ICSCyclerProbe: public ICSCycler { public: virtual void Spawn() = 0; }; -class ICSCyclerSprite: public virtual ICSEntity { +class ICSCyclerSprite: public ICSEntity { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -954,7 +962,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSWeaponCycler: public virtual ICSPlayerWeapon { +class ICSWeaponCycler: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual int GetItemInfo(struct ItemInfo *p) = 0; @@ -965,7 +973,7 @@ public: virtual void SecondaryAttack() = 0; }; -class ICSWreckage: public virtual ICSMonster { +class ICSWreckage: public ICSMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -974,27 +982,27 @@ public: virtual void Think() = 0; }; -class ICSWorldItem: public virtual ICSEntity { +class ICSWorldItem: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSItem: public virtual ICSEntity { +class ICSItem: public ICSEntity { public: virtual void Spawn() = 0; virtual ICSEntity *Respawn() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSHealthKit: public virtual ICSItem { +class ICSHealthKit: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSWallHealth: public virtual ICSToggle { +class ICSWallHealth: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1005,63 +1013,63 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSItemSuit: public virtual ICSItem { +class ICSItemSuit: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemBattery: public virtual ICSItem { +class ICSItemBattery: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemAntidote: public virtual ICSItem { +class ICSItemAntidote: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemSecurity: public virtual ICSItem { +class ICSItemSecurity: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemLongJump: public virtual ICSItem { +class ICSItemLongJump: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemKevlar: public virtual ICSItem { +class ICSItemKevlar: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemAssaultSuit: public virtual ICSItem { +class ICSItemAssaultSuit: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSItemThighPack: public virtual ICSItem { +class ICSItemThighPack: public ICSItem { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual bool MyTouch(CCSPlayer *pPlayer) = 0; }; -class ICSGrenCatch: public virtual ICSEntity { +class ICSGrenCatch: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1072,7 +1080,7 @@ public: virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSFuncWeaponCheck: public virtual ICSEntity { +class ICSFuncWeaponCheck: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1081,7 +1089,7 @@ public: virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSHostage: public virtual ICSMonster { +class ICSHostage: public ICSMonster { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1093,7 +1101,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSLight: public virtual ICSPointEntity { +class ICSLight: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -1103,13 +1111,13 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSEnvLight: public virtual ICSLight { +class ICSEnvLight: public ICSLight { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSRuleEntity: public virtual ICSEntity { +class ICSRuleEntity: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1117,29 +1125,29 @@ public: virtual int Restore(CRestore &restore) = 0; }; -class ICSRulePointEntity: public virtual ICSRuleEntity { +class ICSRulePointEntity: public ICSRuleEntity { public: virtual void Spawn() = 0; }; -class ICSRuleBrushEntity: public virtual ICSRuleEntity { +class ICSRuleBrushEntity: public ICSRuleEntity { public: virtual void Spawn() = 0; }; -class ICSGameScore: public virtual ICSRulePointEntity { +class ICSGameScore: public ICSRulePointEntity { 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 ICSGameEnd: public virtual ICSRulePointEntity { +class ICSGameEnd: public ICSRulePointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGameText: public virtual ICSRulePointEntity { +class ICSGameText: public ICSRulePointEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -1147,7 +1155,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGameTeamMaster: public virtual ICSRulePointEntity { +class ICSGameTeamMaster: public ICSRulePointEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int ObjectCaps() = 0; @@ -1156,12 +1164,12 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGameTeamSet: public virtual ICSRulePointEntity { +class ICSGameTeamSet: public ICSRulePointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGamePlayerZone: public virtual ICSRuleBrushEntity { +class ICSGamePlayerZone: public ICSRuleBrushEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int Save(CSave &save) = 0; @@ -1169,35 +1177,35 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGamePlayerHurt: public virtual ICSRulePointEntity { +class ICSGamePlayerHurt: public ICSRulePointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGameCounter: public virtual ICSRulePointEntity { +class ICSGameCounter: public ICSRulePointEntity { public: virtual void Spawn() = 0; virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGameCounterSet: public virtual ICSRulePointEntity { +class ICSGameCounterSet: public ICSRulePointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGamePlayerEquip: public virtual ICSRulePointEntity { +class ICSGamePlayerEquip: public ICSRulePointEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual void Touch(CCSEntity *pOther) = 0; virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSGamePlayerTeam: public virtual ICSRulePointEntity { +class ICSGamePlayerTeam: public ICSRulePointEntity { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSFuncMortarField: public virtual ICSToggle { +class ICSFuncMortarField: public ICSToggle { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1207,19 +1215,19 @@ public: virtual int ObjectCaps() = 0; }; -class ICSMortar: public virtual ICSGrenade { +class ICSMortar: public ICSGrenade { public: virtual void Spawn() = 0; virtual void Precache() = 0; }; -class ICSMapInfo: public virtual ICSPointEntity { +class ICSMapInfo: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSPathCorner: public virtual ICSPointEntity { +class ICSPathCorner: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1228,7 +1236,7 @@ public: virtual float GetDelay() = 0; }; -class ICSPathTrack: public virtual ICSPointEntity { +class ICSPathTrack: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1238,7 +1246,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSFuncTrackTrain: public virtual ICSEntity { +class ICSFuncTrackTrain: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1253,13 +1261,13 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSFuncVehicleControls: public virtual ICSEntity { +class ICSFuncVehicleControls: public ICSEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; }; -class ICSFuncVehicle: public virtual ICSEntity { +class ICSFuncVehicle: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1275,7 +1283,7 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSPlatTrain: public virtual ICSToggle { +class ICSPlatTrain: public ICSToggle { public: virtual void Precache() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1285,7 +1293,7 @@ public: virtual bool IsTogglePlat() = 0; }; -class ICSFuncPlat: public virtual ICSPlatTrain { +class ICSFuncPlat: public ICSPlatTrain { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1296,13 +1304,13 @@ public: virtual void HitBottom() = 0; }; -class ICSPlatTrigger: public virtual ICSEntity { +class ICSPlatTrigger: public ICSEntity { public: virtual int ObjectCaps() = 0; virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSFuncPlatRot: public virtual ICSFuncPlat { +class ICSFuncPlatRot: public ICSFuncPlat { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -1313,7 +1321,7 @@ public: virtual void HitBottom() = 0; }; -class ICSFuncTrain: public virtual ICSPlatTrain { +class ICSFuncTrain: public ICSPlatTrain { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1327,13 +1335,13 @@ public: virtual void Blocked(CCSEntity *pOther) = 0; }; -class ICSFuncTrainControls: public virtual ICSEntity { +class ICSFuncTrainControls: public ICSEntity { public: virtual void Spawn() = 0; virtual int ObjectCaps() = 0; }; -class ICSFuncTrackChange: public virtual ICSFuncPlatRot { +class ICSFuncTrackChange: public ICSFuncPlatRot { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1351,13 +1359,13 @@ public: virtual void UpdateAutoTargets(int toggleState) = 0; }; -class ICSFuncTrackAuto: public virtual ICSFuncTrackChange { +class ICSFuncTrackAuto: public ICSFuncTrackChange { public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; virtual void UpdateAutoTargets(int toggleState) = 0; }; -class ICSGunTarget: public virtual ICSMonster { +class ICSGunTarget: public ICSMonster { public: virtual void Spawn() = 0; virtual int Save(CSave &save) = 0; @@ -1371,7 +1379,7 @@ public: virtual Vector BodyTarget(const Vector &posSrc) = 0; }; -class ICSAmbientGeneric: public virtual ICSEntity { +class ICSAmbientGeneric: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1382,7 +1390,7 @@ public: virtual int ObjectCaps() = 0; }; -class ICSEnvSound: public virtual ICSPointEntity { +class ICSEnvSound: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1391,7 +1399,7 @@ public: virtual void Think() = 0; }; -class ICSSpeaker: public virtual ICSEntity { +class ICSSpeaker: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1401,7 +1409,7 @@ public: virtual int ObjectCaps() = 0; }; -class ICSSoundEnt: public virtual ICSEntity { +class ICSSoundEnt: public ICSEntity { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1409,7 +1417,7 @@ public: virtual void Think() = 0; }; -class ICSUSP: public virtual ICSPlayerWeapon { +class ICSUSP: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1424,7 +1432,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSMP5N: public virtual ICSPlayerWeapon { +class ICSMP5N: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1438,7 +1446,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSSG552: public virtual ICSPlayerWeapon { +class ICSSG552: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1453,7 +1461,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSAK47: public virtual ICSPlayerWeapon { +class ICSAK47: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1468,7 +1476,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSAUG: public virtual ICSPlayerWeapon { +class ICSAUG: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1483,7 +1491,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSAWP: public virtual ICSPlayerWeapon { +class ICSAWP: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1498,7 +1506,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSC4: public virtual ICSPlayerWeapon { +class ICSC4: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1514,7 +1522,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSDEAGLE: public virtual ICSPlayerWeapon { +class ICSDEAGLE: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1530,7 +1538,7 @@ public: virtual bool IsPistol() = 0; }; -class ICSFlashbang: public virtual ICSPlayerWeapon { +class ICSFlashbang: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1548,7 +1556,7 @@ public: virtual bool IsPistol() = 0; }; -class ICSG3SG1: public virtual ICSPlayerWeapon { +class ICSG3SG1: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1563,7 +1571,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSGLOCK18: public virtual ICSPlayerWeapon { +class ICSGLOCK18: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1578,7 +1586,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSHEGrenade: public virtual ICSPlayerWeapon { +class ICSHEGrenade: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1595,7 +1603,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSKnife: public virtual ICSPlayerWeapon { +class ICSKnife: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1610,7 +1618,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSM249: public virtual ICSPlayerWeapon { +class ICSM249: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1624,7 +1632,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSM3: public virtual ICSPlayerWeapon { +class ICSM3: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1638,7 +1646,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSM4A1: public virtual ICSPlayerWeapon { +class ICSM4A1: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1653,7 +1661,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSMAC10: public virtual ICSPlayerWeapon { +class ICSMAC10: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1667,7 +1675,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSP228: public virtual ICSPlayerWeapon { +class ICSP228: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1683,7 +1691,7 @@ public: virtual bool IsPistol() = 0; }; -class ICSP90: public virtual ICSPlayerWeapon { +class ICSP90: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1697,7 +1705,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSSCOUT: public virtual ICSPlayerWeapon { +class ICSSCOUT: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1712,7 +1720,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSSmokeGrenade: public virtual ICSPlayerWeapon { +class ICSSmokeGrenade: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1729,7 +1737,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSTMP: public virtual ICSPlayerWeapon { +class ICSTMP: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1743,7 +1751,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSXM1014: public virtual ICSPlayerWeapon { +class ICSXM1014: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1757,7 +1765,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSELITE: public virtual ICSPlayerWeapon { +class ICSELITE: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1771,7 +1779,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSFiveSeven: public virtual ICSPlayerWeapon { +class ICSFiveSeven: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1786,7 +1794,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSUMP45: public virtual ICSPlayerWeapon { +class ICSUMP45: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1800,7 +1808,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSSG550: public virtual ICSPlayerWeapon { +class ICSSG550: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1815,7 +1823,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSGalil: public virtual ICSPlayerWeapon { +class ICSGalil: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1830,7 +1838,7 @@ public: virtual bool UseDecrement() = 0; }; -class ICSFamas: public virtual ICSPlayerWeapon { +class ICSFamas: public ICSPlayerWeapon { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1845,18 +1853,18 @@ public: virtual bool UseDecrement() = 0; }; -class ICSNullEntity: public virtual ICSEntity { +class ICSNullEntity: public ICSEntity { public: virtual void Spawn() = 0; }; -class ICSDMStart: public virtual ICSPointEntity { +class ICSDMStart: public ICSPointEntity { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual bool IsTriggered(CCSEntity *pEntity) = 0; }; -class ICSFrictionModifier: public virtual ICSEntity { +class ICSFrictionModifier: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1865,7 +1873,7 @@ public: virtual int ObjectCaps() = 0; }; -class ICSAutoTrigger: public virtual ICSDelay { +class ICSAutoTrigger: public ICSDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1876,7 +1884,7 @@ public: virtual void Think() = 0; }; -class ICSTriggerRelay: public virtual ICSDelay { +class ICSTriggerRelay: public ICSDelay { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1886,7 +1894,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSMultiManager: public virtual ICSToggle { +class ICSMultiManager: public ICSToggle { public: virtual void Spawn() = 0; virtual void Restart() = 0; @@ -1897,38 +1905,38 @@ public: virtual bool HasTarget(string_t targetname) = 0; }; -class ICSRenderFxManager: public virtual ICSEntity { +class ICSRenderFxManager: public ICSEntity { public: virtual void Spawn() = 0; virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSTrigger: public virtual ICSToggle { +class ICSTrigger: public ICSToggle { public: virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual int ObjectCaps() = 0; }; -class ICSTriggerHurt: public virtual ICSTrigger { +class ICSTriggerHurt: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerMonsterJump: public virtual ICSTrigger { +class ICSTriggerMonsterJump: public ICSTrigger { public: virtual void Spawn() = 0; virtual void Think() = 0; virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSTriggerCDAudio: public virtual ICSTrigger { +class ICSTriggerCDAudio: public ICSTrigger { public: virtual void Spawn() = 0; virtual void Touch(CCSEntity *pOther) = 0; virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSTargetCDAudio: public virtual ICSPointEntity { +class ICSTargetCDAudio: public ICSPointEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1936,27 +1944,27 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSTriggerMultiple: public virtual ICSTrigger { +class ICSTriggerMultiple: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerOnce: public virtual ICSTriggerMultiple { +class ICSTriggerOnce: public ICSTriggerMultiple { public: virtual void Spawn() = 0; }; -class ICSTriggerCounter: public virtual ICSTrigger { +class ICSTriggerCounter: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerVolume: public virtual ICSPointEntity { +class ICSTriggerVolume: public ICSPointEntity { public: virtual void Spawn() = 0; }; -class ICSFireAndDie: public virtual ICSDelay { +class ICSFireAndDie: public ICSDelay { public: virtual void Spawn() = 0; virtual void Precache() = 0; @@ -1964,7 +1972,7 @@ public: virtual void Think() = 0; }; -class ICSChangeLevel: public virtual ICSTrigger { +class ICSChangeLevel: public ICSTrigger { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -1972,67 +1980,67 @@ public: virtual int Restore(CRestore &restore) = 0; }; -class ICSLadder: public virtual ICSTrigger { +class ICSLadder: public ICSTrigger { public: virtual void Spawn() = 0; virtual void Precache() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSTriggerPush: public virtual ICSTrigger { +class ICSTriggerPush: public ICSTrigger { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; virtual void Touch(CCSEntity *pOther) = 0; }; -class ICSTriggerTeleport: public virtual ICSTrigger { +class ICSTriggerTeleport: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSBuyZone: public virtual ICSTrigger { +class ICSBuyZone: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSBombTarget: public virtual ICSTrigger { +class ICSBombTarget: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSHostageRescue: public virtual ICSTrigger { +class ICSHostageRescue: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSEscapeZone: public virtual ICSTrigger { +class ICSEscapeZone: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSVIP_SafetyZone: public virtual ICSTrigger { +class ICSVIP_SafetyZone: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerSave: public virtual ICSTrigger { +class ICSTriggerSave: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerEndSection: public virtual ICSTrigger { +class ICSTriggerEndSection: public ICSTrigger { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; }; -class ICSTriggerGravity: public virtual ICSTrigger { +class ICSTriggerGravity: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSTriggerChangeTarget: public virtual ICSDelay { +class ICSTriggerChangeTarget: public ICSDelay { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -2042,7 +2050,7 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSTriggerCamera: public virtual ICSDelay { +class ICSTriggerCamera: public ICSDelay { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; @@ -2052,12 +2060,12 @@ public: virtual void Use(CCSEntity *pActivator, CCSEntity *pCaller, USE_TYPE useType, float value) = 0; }; -class ICSWeather: public virtual ICSTrigger { +class ICSWeather: public ICSTrigger { public: virtual void Spawn() = 0; }; -class ICSClientFog: public virtual ICSEntity { +class ICSClientFog: public ICSEntity { public: virtual void Spawn() = 0; virtual void KeyValue(struct KeyValueData_s *pkvd) = 0; diff --git a/reapi/include/cssdk/engine/hookchains_.h b/reapi/include/cssdk/engine/hookchains_rehlds.h similarity index 100% rename from reapi/include/cssdk/engine/hookchains_.h rename to reapi/include/cssdk/engine/hookchains_rehlds.h diff --git a/reapi/include/cssdk/public/interface.h b/reapi/include/cssdk/public/interface.h index c9ce2e6..3349146 100644 --- a/reapi/include/cssdk/public/interface.h +++ b/reapi/include/cssdk/public/interface.h @@ -52,7 +52,7 @@ typedef IBaseInterface* (*CreateInterfaceFn)(const char *pName, int *pReturnCode typedef IBaseInterface* (*InstantiateInterfaceFn)(); -// Used internally to classes. +// Used internally to register classes. class InterfaceReg { public: diff --git a/reapi/msvc/reapi.vcxproj b/reapi/msvc/reapi.vcxproj index dbb2b59..ff0239e 100644 --- a/reapi/msvc/reapi.vcxproj +++ b/reapi/msvc/reapi.vcxproj @@ -202,6 +202,7 @@ + @@ -237,6 +238,7 @@ + diff --git a/reapi/msvc/reapi.vcxproj.filters b/reapi/msvc/reapi.vcxproj.filters index 66991e9..456aa95 100644 --- a/reapi/msvc/reapi.vcxproj.filters +++ b/reapi/msvc/reapi.vcxproj.filters @@ -49,6 +49,9 @@ {c4bfa412-f9f4-4b90-9f02-3c1531e2ac23} + + {1e41b4f5-768c-437f-af6d-51432194e332} + @@ -619,10 +622,13 @@ src - src + src\natives - src + src\natives + + + src\natives @@ -684,10 +690,13 @@ src - src + src\natives - src + src\natives + + + src\natives diff --git a/reapi/src/amxxmodule.cpp b/reapi/src/amxxmodule.cpp index 05911cf..1a998ef 100644 --- a/reapi/src/amxxmodule.cpp +++ b/reapi/src/amxxmodule.cpp @@ -161,6 +161,8 @@ C_DLLEXPORT int AMXX_Attach(PFN_REQ_FNPTR reqFnptrFunc) RegisterNatives_HookChains(); RegisterNatives_Members(); + RegisterNatives_Misc(); + return AMXX_OK; } diff --git a/reapi/src/amxxmodule.h b/reapi/src/amxxmodule.h index bc47e36..8977a22 100644 --- a/reapi/src/amxxmodule.h +++ b/reapi/src/amxxmodule.h @@ -511,7 +511,7 @@ struct getAmxString getAmxString(AMX* amx, cell addr, size_t* len = nullptr) { - getAmxString(getAmxAddr(amx, addr), len); + getAmxStringTemp(getAmxAddr(amx, addr), temp, sizeof temp - 1, len); } operator char *() diff --git a/reapi/src/api_config.cpp b/reapi/src/api_config.cpp index f82d916..e4fbcc5 100644 --- a/reapi/src/api_config.cpp +++ b/reapi/src/api_config.cpp @@ -14,3 +14,17 @@ bool CAPI_Config::Init() return true; } + +void CAPI_Config::ServerActivate() +{ + if (m_api_regame) { + g_pCSGameRules = (CHalfLifeMultiplay **)g_ReGameApi->GetGameData()->GetGameRules(); + } +} + +void CAPI_Config::ServerDeactivate() +{ + if (m_api_regame) { + g_pCSGameRules = nullptr; + } +} diff --git a/reapi/src/api_config.h b/reapi/src/api_config.h index 9ef05bd..47bf604 100644 --- a/reapi/src/api_config.h +++ b/reapi/src/api_config.h @@ -11,6 +11,9 @@ public: bool hasReHLDS() const { return m_api_rehlds; } bool hasReGameDLL() const { return m_api_regame; } + void ServerActivate(); + void ServerDeactivate(); + private: // to provide API functions bool m_api_rehlds; // some useful functions diff --git a/reapi/src/dllapi.cpp b/reapi/src/dllapi.cpp index 748c27e..cbf822f 100644 --- a/reapi/src/dllapi.cpp +++ b/reapi/src/dllapi.cpp @@ -1,6 +1,6 @@ #include "precompiled.h" -extern void ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax); +extern void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); extern void ServerDeactivate_Post(); DLL_FUNCTIONS gFunctionTable = @@ -26,7 +26,7 @@ DLL_FUNCTIONS gFunctionTable = NULL, // pfnClientPutInServer NULL, // pfnClientCommand NULL, // pfnClientUserInfoChanged - NULL, // pfnServerActivate + &ServerActivate, // pfnServerActivate NULL, // pfnServerDeactivate NULL, // pfnPlayerPreThink NULL, // pfnPlayerPostThink @@ -80,7 +80,7 @@ DLL_FUNCTIONS gFunctionTable_Post = NULL, // pfnClientPutInServer NULL, // pfnClientCommand NULL, // pfnClientUserInfoChanged - &ServerActivate_Post, // pfnServerActivate + NULL, // pfnServerActivate &ServerDeactivate_Post, // pfnServerDeactivate NULL, // pfnPlayerPreThink NULL, // pfnPlayerPostThink diff --git a/reapi/src/hook_callback.cpp b/reapi/src/hook_callback.cpp index 2a3428f..ec729b5 100644 --- a/reapi/src/hook_callback.cpp +++ b/reapi/src/hook_callback.cpp @@ -280,6 +280,66 @@ CBaseEntity *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer return callForward(RH_CBasePlayer_Observer_IsValidTarget, original, pthis->entindex(), iPlayerIndex, bSameTeam); } +void CBasePlayer_SetAnimation(IReGameHook_CBasePlayer_SetAnimation *chain, CBasePlayer *pthis, PLAYER_ANIM playerAnim) +{ + auto original = [chain](int _pthis, PLAYER_ANIM _playerAnim) + { + chain->callNext(_playerAnim); + }; + + callVoidForward(RH_CBasePlayer_SetAnimation, original, pthis->entindex(), playerAnim); +} + +void CBasePlayer_GiveDefaultItems(IReGameHook_CBasePlayer_GiveDefaultItems *chain, CBasePlayer *pthis) +{ + auto original = [chain](int _pthis) + { + chain->callNext(); + }; + + callVoidForward(RH_CBasePlayer_GiveDefaultItems, original, pthis->entindex()); +} + +void CBasePlayer_GiveNamedItem(IReGameHook_CBasePlayer_GiveNamedItem *chain, CBasePlayer *pthis, const char *pszName) +{ + auto original = [chain](int _pthis, const char *_pszName) + { + chain->callNext(_pszName); + }; + + callVoidForward(RH_CBasePlayer_GiveNamedItem, original, pthis->entindex(), pszName); +} + +void CBasePlayer_AddAccount(IReGameHook_CBasePlayer_AddAccount *chain, CBasePlayer *pthis, int amount, bool bTrackChange) +{ + auto original = [chain](int _pthis, int _amount, bool _bTrackChange) + { + chain->callNext(_amount, _bTrackChange); + }; + + callVoidForward(RH_CBasePlayer_AddAccount, original, pthis->entindex(), amount, bTrackChange); +} + +void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlayer *pthis, bool bDeploy) +{ + auto original = [chain](int _pthis, bool _bDeploy) + { + chain->callNext(_bDeploy); + }; + + callVoidForward(RH_CBasePlayer_GiveShield, original, pthis->entindex(), bDeploy); +} + +void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis) +{ + auto original = [chain](int _pthis) + { + chain->callNext(); + }; + + callVoidForward(RH_CBaseAnimating_ResetSequenceInfo, original, pthis->entindex()); +} + int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver) { auto original = [chain](int _pObserver) @@ -289,3 +349,27 @@ int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver) return callForward(RH_GetForceCamera, original, pObserver->entindex()); } + +void PlayerBlind(IReGameHook_PlayerBlind *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, float fadeTime, float fadeHold, int alpha, Vector& color) +{ + Vector colorCopy(color); + + auto original = [chain, &colorCopy](int _pPlayer, int _pevInflictor, int _pevAttacker, float _fadeTime, float _fadeHold, int _alpha, cell _color) + { + chain->callNext(getPrivate(_pPlayer), PEV(_pevInflictor), PEV(_pevAttacker), _fadeTime, _fadeHold, _alpha, colorCopy); + }; + + callVoidForward(RH_PlayerBlind, original, pPlayer->entindex(), indexOfEdict(pevInflictor), indexOfEdict(pevAttacker), fadeTime, fadeHold, alpha, g_amxxapi.PrepareCellArrayA(reinterpret_cast(&colorCopy), 3, true)); +} + +void RadiusFlash_TraceLine(IReGameHook_RadiusFlash_TraceLine *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector& vecSrc, Vector& vecSpot, TraceResult *ptr) +{ + Vector vecSrcCopy(vecSrc), vecSpotCopy(vecSpot); + + auto original = [chain, &vecSrcCopy, &vecSpotCopy](int _pPlayer, int _pevInflictor, int _pevAttacker, cell _vecSrc, cell _vecSpot, int _ptr) + { + chain->callNext(getPrivate(_pPlayer), PEV(_pevInflictor), PEV(_pevAttacker), vecSrcCopy, vecSpotCopy, (TraceResult *)_ptr); + }; + + callVoidForward(RH_RadiusFlash_TraceLine, original, pPlayer->entindex(), indexOfEdict(pevInflictor), indexOfEdict(pevAttacker), g_amxxapi.PrepareCellArrayA(reinterpret_cast(&vecSrcCopy), 3, true), g_amxxapi.PrepareCellArrayA(reinterpret_cast(&vecSpotCopy), 3, true), int(ptr)); +} diff --git a/reapi/src/hook_callback.h b/reapi/src/hook_callback.h index b52bbd9..7061573 100644 --- a/reapi/src/hook_callback.h +++ b/reapi/src/hook_callback.h @@ -88,7 +88,7 @@ NOINLINE void DLLEXPORT _callVoidForward(const hook_t* hook, original_t original { if (fwd->GetState() == FSTATE_ENABLED) { - auto ret = g_amxxapi.ExecuteForward(fwd->m_forward, args...); + auto ret = g_amxxapi.ExecuteForward(fwd->GetIndex(), args...); if (ret == HC_BREAK) { return; @@ -102,11 +102,9 @@ NOINLINE void DLLEXPORT _callVoidForward(const hook_t* hook, original_t original if (hc_state != HC_SUPERCEDE) original(args...); - for (auto& fwd : hook->post) - { - if (fwd->GetState() == FSTATE_ENABLED) - { - auto ret = g_amxxapi.ExecuteForward(fwd->m_forward, args...); + for (auto& fwd : hook->post) { + if (fwd->GetState() == FSTATE_ENABLED) { + auto ret = g_amxxapi.ExecuteForward(fwd->GetIndex(), args...); if (ret == HC_BREAK) break; @@ -138,7 +136,7 @@ NOINLINE R DLLEXPORT _callForward(const hook_t* hook, original_t original, volat { if (fwd->GetState() == FSTATE_ENABLED) { - auto ret = g_amxxapi.ExecuteForward(fwd->m_forward, args...); + auto ret = g_amxxapi.ExecuteForward(fwd->GetIndex(), args...); if (ret == HC_CONTINUE) continue; @@ -167,7 +165,7 @@ NOINLINE R DLLEXPORT _callForward(const hook_t* hook, original_t original, volat for (auto& fwd : hook->post) { if (fwd->GetState() == FSTATE_ENABLED) { - auto ret = g_amxxapi.ExecuteForward(fwd->m_forward, args...); + auto ret = g_amxxapi.ExecuteForward(fwd->GetIndex(), args...); if (ret == HC_BREAK) break; @@ -200,6 +198,9 @@ void Cvar_DirectSet(IRehldsHook_Cvar_DirectSet *chain, cvar_t *var, const char * // regamedll functions int GetForceCamera(IReGameHook_GetForceCamera *chain, CBasePlayer *pObserver); +void PlayerBlind(IReGameHook_PlayerBlind *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, float fadeTime, float fadeHold, int alpha, Vector& color); +void RadiusFlash_TraceLine(IReGameHook_RadiusFlash_TraceLine *chain, CBasePlayer *pPlayer, entvars_t *pevInflictor, entvars_t *pevAttacker, Vector& vecSrc, Vector& vecSpot, TraceResult *ptr); + // regamedll functions - player void CBasePlayer_Spawn(IReGameHook_CBasePlayer_Spawn *chain, CBasePlayer *pthis); @@ -224,4 +225,13 @@ void CBasePlayer_UpdateClientData(IReGameHook_CBasePlayer_UpdateClientData *chai void CBasePlayer_ImpulseCommands(IReGameHook_CBasePlayer_ImpulseCommands *chain, CBasePlayer *pthis); void CBasePlayer_RoundRespawn(IReGameHook_CBasePlayer_RoundRespawn *chain, CBasePlayer *pthis); void CBasePlayer_Blind(IReGameHook_CBasePlayer_Blind *chain, CBasePlayer *pthis, float flUntilTime, float flHoldTime, float flFadeTime, int iAlpha); + CBaseEntity *CBasePlayer_Observer_IsValidTarget(IReGameHook_CBasePlayer_Observer_IsValidTarget *chain, CBasePlayer *pthis, int iPlayerIndex, bool bSameTeam); +void CBasePlayer_SetAnimation(IReGameHook_CBasePlayer_SetAnimation *chain, CBasePlayer *pthis, PLAYER_ANIM playerAnim); +void CBasePlayer_GiveDefaultItems(IReGameHook_CBasePlayer_GiveDefaultItems *chain, CBasePlayer *pthis); +void CBasePlayer_GiveNamedItem(IReGameHook_CBasePlayer_GiveNamedItem *chain, CBasePlayer *pthis, const char *pszName); +void CBasePlayer_AddAccount(IReGameHook_CBasePlayer_AddAccount *chain, CBasePlayer *pthis, int amount, bool bTrackChange); +void CBasePlayer_GiveShield(IReGameHook_CBasePlayer_GiveShield *chain, CBasePlayer *pthis, bool bDeploy); + + +void CBaseAnimating_ResetSequenceInfo(IReGameHook_CBaseAnimating_ResetSequenceInfo *chain, CBaseAnimating *pthis); diff --git a/reapi/src/hook_list.cpp b/reapi/src/hook_list.cpp index 24df3e7..fbd937b 100644 --- a/reapi/src/hook_list.cpp +++ b/reapi/src/hook_list.cpp @@ -2,7 +2,7 @@ int regfunc::current_cell = 1; -#define ENG(h) { {}, {}, #h, "ReHLDS", [](){ return api_cfg.hasReHLDS(); }, ((!(RH_##h & 1023) ? regfunc::current_cell = 1, true : false) || (RH_##h & 1023) == regfunc::current_cell++) ? regfunc(h) : regfunc(#h " doesn't match hook definition"), [](){ g_RehldsHookchains->##h##()->registerHook(&##h); }, [](){ g_RehldsHookchains->##h##()->unregisterHook(&##h); }} +#define ENG(h) { {}, {}, #h, "ReHLDS", [](){ return api_cfg.hasReHLDS(); }, ((!(RH_##h & (MAX_REGION_RANGE - 1)) ? regfunc::current_cell = 1, true : false) || (RH_##h & (MAX_REGION_RANGE - 1)) == regfunc::current_cell++) ? regfunc(h) : regfunc(#h " doesn't match hook definition"), [](){ g_RehldsHookchains->##h##()->registerHook(&##h); }, [](){ g_RehldsHookchains->##h##()->unregisterHook(&##h); }} hook_t hooklist_engine[] = { ENG(SV_StartSound), ENG(SV_DropClient), @@ -10,9 +10,15 @@ hook_t hooklist_engine[] = { ENG(Cvar_DirectSet) }; -#define DLL(h) { {}, {}, #h, "ReGameDLL", [](){ return api_cfg.hasReGameDLL(); }, ((!(RH_##h & 1023) ? regfunc::current_cell = 1, true : false) || (RH_##h & 1023) == regfunc::current_cell++) ? regfunc(h) : regfunc(#h " doesn't match hook definition"), [](){ g_ReGameHookchains->##h##()->registerHook(&##h); }, [](){ g_ReGameHookchains->##h##()->unregisterHook(&##h); }} +#define DLL(h) { {}, {}, #h, "ReGameDLL", [](){ return api_cfg.hasReGameDLL(); }, ((!(RH_##h & (MAX_REGION_RANGE - 1)) ? regfunc::current_cell = 1, true : false) || (RH_##h & (MAX_REGION_RANGE - 1)) == regfunc::current_cell++) ? regfunc(h) : regfunc(#h " doesn't match hook definition"), [](){ g_ReGameHookchains->##h##()->registerHook(&##h); }, [](){ g_ReGameHookchains->##h##()->unregisterHook(&##h); }} hook_t hooklist_gamedll[] = { - DLL(GetForceCamera) + DLL(GetForceCamera), + DLL(PlayerBlind), + DLL(RadiusFlash_TraceLine) +}; + +hook_t hooklist_animating[] = { + DLL(CBaseAnimating_ResetSequenceInfo) }; hook_t hooklist_player[] = { @@ -38,7 +44,13 @@ hook_t hooklist_player[] = { DLL(CBasePlayer_ImpulseCommands), DLL(CBasePlayer_RoundRespawn), DLL(CBasePlayer_Blind), + DLL(CBasePlayer_Observer_IsValidTarget), + DLL(CBasePlayer_SetAnimation), + DLL(CBasePlayer_GiveDefaultItems), + DLL(CBasePlayer_GiveNamedItem), + DLL(CBasePlayer_AddAccount), + DLL(CBasePlayer_GiveShield), }; hook_t* hooklist_t::getHookSafe(size_t hook) @@ -51,6 +63,7 @@ hook_t* hooklist_t::getHookSafe(size_t hook) switch (table) { CASE(engine) CASE(gamedll) + CASE(animating) CASE(player) } diff --git a/reapi/src/hook_list.h b/reapi/src/hook_list.h index bb46034..9771ca4 100644 --- a/reapi/src/hook_list.h +++ b/reapi/src/hook_list.h @@ -1,10 +1,10 @@ #pragma once #define MAX_REGION_RANGE 1024 -#define BEGIN_FUNC_REGION(x) (MAX_REGION_RANGE * hooklist_t::hooks_tables_e::ht_##x) +#define BEGIN_FUNC_REGION(x) (MAX_REGION_RANGE * hooklist_t::hooks_tables_e::ht_##x) #define MAX_HOOK_FORWARDS 1024 -typedef bool (*ablfunc_t)(); +typedef bool (*reqfunc_t)(); typedef int (*regfunc_t)(AMX *, const char *); typedef void (*regchain_t)(); @@ -30,11 +30,31 @@ struct regfunc func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_STRING, FP_DONE); }; } + template + regfunc(R (*)(T *, CBaseAnimating *)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_DONE); }; + } + template regfunc(R (*)(T *, CBasePlayer *)) { func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_DONE); }; } + template + regfunc(R (*)(T *, CBasePlayer *, const char *)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_STRING, FP_DONE); }; + } + + template + regfunc(R (*)(T *, CBasePlayer *, bool)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_DONE); }; + } + + template + regfunc(R (*)(T *, CBasePlayer *, PLAYER_ANIM)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_DONE); }; + } + template regfunc(R (*)(T *, CBasePlayer *, entvars_t *, float, Vector&, TraceResult *, int)) { func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_FLOAT, FP_ARRAY, FP_CELL, FP_CELL, FP_DONE); }; @@ -57,7 +77,7 @@ struct regfunc template regfunc(R (*)(T *, CBasePlayer *, int, BOOL)) { - func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_DONE); }; + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_CELL, FP_DONE); }; } template @@ -72,12 +92,22 @@ struct regfunc template regfunc(R (*)(T *, CBasePlayer *, float, float, float, int)) { - func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE); }; + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_FLOAT, FP_FLOAT, FP_FLOAT, FP_CELL, FP_DONE); }; } template regfunc(R (*)(T *, CBasePlayer *, int, bool)) { - func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_DONE); }; + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_CELL, FP_DONE); }; + } + + template + regfunc(R (*)(T *, CBasePlayer *, entvars_t *, entvars_t *, float, float, int, Vector&)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_CELL, FP_FLOAT, FP_FLOAT, FP_CELL, FP_ARRAY, FP_DONE); }; + } + + template + regfunc(R (*)(T *, CBasePlayer *, entvars_t *, entvars_t *, Vector&, Vector&, TraceResult *)) { + func = [](AMX *amx, const char *name) { return g_amxxapi.RegisterSPForwardByName(amx, name, FP_CELL, FP_CELL, FP_CELL, FP_ARRAY, FP_ARRAY, FP_CELL, FP_DONE); }; } regfunc(const char *error) { UTIL_SysError(error); } // to cause a amxx module failure. @@ -95,7 +125,7 @@ struct hook_t const char *func_name; // function name const char *depend_name; // platform dependency - ablfunc_t checkRequirements; + reqfunc_t checkRequirements; regfunc_t registerForward; // AMXX forward registration function regchain_t registerHookchain; // register re* API hook regchain_t unregisterHookchain; // unregister re* API hook @@ -103,6 +133,7 @@ struct hook_t extern hook_t hooklist_engine[]; extern hook_t hooklist_gamedll[]; +extern hook_t hooklist_animating[]; extern hook_t hooklist_player[]; struct hooklist_t @@ -117,6 +148,7 @@ struct hooklist_t switch (table) { CASE(engine) CASE(gamedll) + CASE(animating) CASE(player) } @@ -129,6 +161,7 @@ struct hooklist_t { ht_engine, ht_gamedll, + ht_animating, ht_player, ht_end @@ -181,11 +214,21 @@ enum EngineFunc enum GamedllFunc { RH_GetForceCamera = BEGIN_FUNC_REGION(gamedll), + RH_PlayerBlind, + RH_RadiusFlash_TraceLine, // [...] RH_GameDLL_End }; +enum GamedllFunc_CBaseAnimating +{ + RH_CBaseAnimating_ResetSequenceInfo = BEGIN_FUNC_REGION(animating), + + // [...] + RH_CBaseAnimating_End +}; + enum GamedllFunc_CBasePlayer { // CBasePlayer virtual @@ -213,6 +256,11 @@ enum GamedllFunc_CBasePlayer RH_CBasePlayer_Blind, RH_CBasePlayer_Observer_IsValidTarget, + RH_CBasePlayer_SetAnimation, + RH_CBasePlayer_GiveDefaultItems, + RH_CBasePlayer_GiveNamedItem, + RH_CBasePlayer_AddAccount, + RH_CBasePlayer_GiveShield, // [...] RH_CBasePlayer_End diff --git a/reapi/src/hook_manager.cpp b/reapi/src/hook_manager.cpp index 579445d..dd07904 100644 --- a/reapi/src/hook_manager.cpp +++ b/reapi/src/hook_manager.cpp @@ -21,6 +21,21 @@ AMX* CAmxxHook::GetAmx() const return m_amx; } +int CAmxxHook::GetIndex() const +{ + return m_index; +} + +fwdstate CAmxxHook::GetState() const +{ + return m_state; +} + +void CAmxxHook::SetState(fwdstate st) +{ + m_state = st; +} + void CHookManager::clearHandlers() const { #define CLEAR_HOOKLIST(__END__, __START__)\ @@ -31,7 +46,7 @@ void CHookManager::clearHandlers() const m_hooklist[i]->post.clear();\ m_hooklist[i]->unregisterHookchain();\ } - + CLEAR_HOOKLIST(EngineFunc, engine); CLEAR_HOOKLIST(GameDLL, gamedll); CLEAR_HOOKLIST(CBasePlayer, player); diff --git a/reapi/src/hook_manager.h b/reapi/src/hook_manager.h index cb9132e..5cab4e7 100644 --- a/reapi/src/hook_manager.h +++ b/reapi/src/hook_manager.h @@ -1,8 +1,6 @@ #pragma once #include "hook_list.h" -//#define MAX_RANGE_HOOKS RH_EngineFunc_End + RH_GameDLL_End + RH_CBasePlayer_End - enum fwdstate { FSTATE_INVALID = 0, @@ -14,14 +12,15 @@ enum fwdstate class CAmxxHook { public: - CAmxxHook(AMX* amx, int forward_index) : m_forward(forward_index), m_state(FSTATE_ENABLED), m_amx(amx) {}; + CAmxxHook(AMX* amx, int index) : m_index(index), m_state(FSTATE_ENABLED), m_amx(amx) {}; - int GetForwardID() const { return m_forward; } - fwdstate GetState() const { return m_state; } + int GetIndex() const; + fwdstate GetState() const; AMX* GetAmx() const; + void SetState(fwdstate st); -public: - int m_forward; +private: + int m_index; fwdstate m_state; AMX* m_amx; }; diff --git a/reapi/src/main.cpp b/reapi/src/main.cpp index c57e893..f82b5d1 100644 --- a/reapi/src/main.cpp +++ b/reapi/src/main.cpp @@ -17,14 +17,18 @@ void OnMetaDetach() g_hookManager.clearHandlers(); } -void ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax) +void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax) { g_pEdicts = pEdictList; - RETURN_META(MRES_IGNORED); + api_cfg.ServerActivate(); + + SET_META_RESULT(MRES_IGNORED); } void ServerDeactivate_Post() { + api_cfg.ServerActivate(); g_hookManager.clearHandlers(); - RETURN_META(MRES_IGNORED); + + SET_META_RESULT(MRES_IGNORED); } diff --git a/reapi/src/member_list.cpp b/reapi/src/member_list.cpp index f7e10df..a545ac3 100644 --- a/reapi/src/member_list.cpp +++ b/reapi/src/member_list.cpp @@ -19,10 +19,7 @@ struct regmember member.type = member_type; } - regmember(const char *error) - { - UTIL_SysError("%s", error); - } // to cause a amxx module failure. + regmember(const char *error) { UTIL_SysError(error); } // to cause a amxx module failure. operator member_t() const { return member; } member_t member; @@ -32,9 +29,8 @@ struct regmember static char mem_dummy[0xffff]; int regmember::current_cell = 1; -#define GM_MEMBERS(mx, mtype) ((!(mx & 1023) ? regmember::current_cell = 1, true : false) || (mx & 1023) == regmember::current_cell++) ? regmember(((CHalfLifeMultiplay *)&mem_dummy)->##mx, sizeof(((CHalfLifeMultiplay *)&mem_dummy)->##mx), offsetof(CHalfLifeMultiplay, mx), mtype) : regmember(#mx " doesn't match hook definition") -#define GM_VOICE_MEMBERS(mx, mtype) ((!(mx & 1023) ? regmember::current_cell = 1, true : false) || (mx & 1023) == regmember::current_cell++) ? regmember(((CVoiceGameMgr *)&mem_dummy)->##mx, sizeof(((CVoiceGameMgr *)&mem_dummy)->##mx), offsetof(CVoiceGameMgr, mx), mtype) : regmember(#mx " doesn't match hook definition") - +#define GM_MEMBERS(mx, mtype) ((!(mx & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (mx & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember(((CHalfLifeMultiplay *)&mem_dummy)->##mx, sizeof(((CHalfLifeMultiplay *)&mem_dummy)->##mx), offsetof(CHalfLifeMultiplay, mx), mtype) : regmember(#mx " doesn't match member definition") +#define GM_VOICE_MEMBERS(mx, mtype) ((!(mx & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (mx & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember(((CVoiceGameMgr *)&mem_dummy)->##mx, sizeof(((CVoiceGameMgr *)&mem_dummy)->##mx), offsetof(CVoiceGameMgr, mx), mtype) : regmember(#mx " doesn't match member definition") member_t memberlist_gamerules[] = { GM_MEMBERS(m_bFreezePeriod, MEMBER_INTEGER), GM_MEMBERS(m_bBombDropped, MEMBER_INTEGER), @@ -94,7 +90,7 @@ member_t memberlist_gamerules[] = { GM_MEMBERS(m_iTotalArmourCount, MEMBER_INTEGER), GM_MEMBERS(m_iUnBalancedRounds, MEMBER_INTEGER), GM_MEMBERS(m_iNumEscapeRounds, MEMBER_INTEGER), - GM_MEMBERS(m_iMapVotes, MEMBER_INTEGER), // ARRAY 100 + GM_MEMBERS(m_iMapVotes, MEMBER_INTEGER), GM_MEMBERS(m_iLastPick, MEMBER_INTEGER), GM_MEMBERS(m_iMaxMapTime, MEMBER_INTEGER), GM_MEMBERS(m_iMaxRounds, MEMBER_INTEGER), @@ -105,7 +101,7 @@ member_t memberlist_gamerules[] = { GM_MEMBERS(m_flForceChaseCamValue, MEMBER_FLOAT), GM_MEMBERS(m_flFadeToBlackValue, MEMBER_FLOAT), GM_MEMBERS(m_pVIP, MEMBER_CLASSPTR), - GM_MEMBERS(VIPQueue, MEMBER_CLASSPTR), // ARRAY [5] + GM_MEMBERS(VIPQueue, MEMBER_CLASSPTR), GM_MEMBERS(m_flIntermissionEndTime, MEMBER_FLOAT), GM_MEMBERS(m_flIntermissionStartTime, MEMBER_FLOAT), GM_MEMBERS(m_iEndIntermissionButtonHit, MEMBER_INTEGER), @@ -119,8 +115,45 @@ member_t memberlist_gamerules[] = { GM_MEMBERS(m_bSkipSpawn, MEMBER_BOOL), }; -#define PL_MEMBERS(mx, mtype) ((!(mx & 1023) ? regmember::current_cell = 1, true : false) || (mx & 1023) == regmember::current_cell++) ? regmember(((CBasePlayer *)&mem_dummy)->##mx, sizeof(((CBasePlayer *)&mem_dummy)->##mx), offsetof(CBasePlayer, mx), mtype) : regmember(#mx " doesn't match hook definition") +#define BASE_MEMBERS(mx, mtype) ((!(mx & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (mx & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember(((CBaseEntity *)&mem_dummy)->##mx, sizeof(((CBaseEntity *)&mem_dummy)->##mx), offsetof(CBaseEntity, mx), mtype) : regmember(#mx " doesn't match member definition") +member_t memberlist_base[] = { + BASE_MEMBERS(currentammo, MEMBER_FLOAT), + BASE_MEMBERS(maxammo_buckshot, MEMBER_INTEGER), + BASE_MEMBERS(ammo_buckshot, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_9mm, MEMBER_INTEGER), + BASE_MEMBERS(ammo_9mm, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_556nato, MEMBER_INTEGER), + BASE_MEMBERS(ammo_556nato, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_556natobox, MEMBER_INTEGER), + BASE_MEMBERS(ammo_556natobox, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_762nato, MEMBER_INTEGER), + BASE_MEMBERS(ammo_762nato, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_45acp, MEMBER_INTEGER), + BASE_MEMBERS(ammo_45acp, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_50ae, MEMBER_INTEGER), + BASE_MEMBERS(ammo_50ae, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_338mag, MEMBER_INTEGER), + BASE_MEMBERS(ammo_338mag, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_57mm, MEMBER_INTEGER), + BASE_MEMBERS(ammo_57mm, MEMBER_INTEGER), + BASE_MEMBERS(maxammo_357sig, MEMBER_INTEGER), + BASE_MEMBERS(ammo_357sig, MEMBER_INTEGER), + BASE_MEMBERS(m_flStartThrow, MEMBER_FLOAT), + BASE_MEMBERS(m_flReleaseThrow, MEMBER_FLOAT), + BASE_MEMBERS(m_iSwing, MEMBER_INTEGER), + BASE_MEMBERS(has_disconnected, MEMBER_BOOL), +}; +#define ANIM_MEMBERS(mx, mtype) ((!(mx & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (mx & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember(((CBaseAnimating *)&mem_dummy)->##mx, sizeof(((CBaseAnimating *)&mem_dummy)->##mx), offsetof(CBaseAnimating, mx), mtype) : regmember(#mx " doesn't match member definition") +member_t memberlist_animating[] = { + ANIM_MEMBERS(m_flFrameRate, MEMBER_FLOAT), + ANIM_MEMBERS(m_flGroundSpeed, MEMBER_FLOAT), + ANIM_MEMBERS(m_flLastEventCheck, MEMBER_FLOAT), + ANIM_MEMBERS(m_fSequenceFinished, MEMBER_INTEGER), + ANIM_MEMBERS(m_fSequenceLoops, MEMBER_INTEGER), +}; + +#define PL_MEMBERS(mx, mtype) ((!(mx & (MAX_REGION_RANGE - 1)) ? regmember::current_cell = 1, true : false) || (mx & (MAX_REGION_RANGE - 1)) == regmember::current_cell++) ? regmember(((CBasePlayer *)&mem_dummy)->##mx, sizeof(((CBasePlayer *)&mem_dummy)->##mx), offsetof(CBasePlayer, mx), mtype) : regmember(#mx " doesn't match member definition") member_t memberlist_player[] = { PL_MEMBERS(random_seed, MEMBER_INTEGER), PL_MEMBERS(m_usPlayerBleed, MEMBER_SHORT), @@ -158,7 +191,7 @@ member_t memberlist_player[] = { PL_MEMBERS(m_iIgnoreGlobalChat, MEMBER_INTEGER), PL_MEMBERS(m_bHasNightVision, MEMBER_BOOL), PL_MEMBERS(m_bNightVisionOn, MEMBER_BOOL), - PL_MEMBERS(m_vRecentPath, MEMBER_VECTOR), // ARRAY [20] + PL_MEMBERS(m_vRecentPath, MEMBER_VECTOR), PL_MEMBERS(m_flIdleCheckTime, MEMBER_FLOAT), PL_MEMBERS(m_flRadioTime, MEMBER_FLOAT), PL_MEMBERS(m_iRadioMessages, MEMBER_INTEGER), @@ -191,7 +224,7 @@ member_t memberlist_player[] = { PL_MEMBERS(m_bReceivesNoMoneyNextRound, MEMBER_BOOL), PL_MEMBERS(m_iTimeCheckAllowed, MEMBER_INTEGER), PL_MEMBERS(m_bHasChangedName, MEMBER_BOOL), - PL_MEMBERS(m_szNewName, MEMBER_CHAR_ARRAY), // ARRAY [32] + PL_MEMBERS(m_szNewName, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_bIsDefusing, MEMBER_BOOL), PL_MEMBERS(m_tmHandleSignals, MEMBER_FLOAT), PL_MEMBERS(m_signals, MEMBER_SIGNALS), @@ -211,7 +244,7 @@ member_t memberlist_player[] = { PL_MEMBERS(m_flSndRoomtype, MEMBER_FLOAT), PL_MEMBERS(m_flSndRange, MEMBER_FLOAT), PL_MEMBERS(m_flFallVelocity, MEMBER_FLOAT), - PL_MEMBERS(m_rgItems, MEMBER_INTEGER), // ARRAY [4] + PL_MEMBERS(m_rgItems, MEMBER_INTEGER), PL_MEMBERS(m_fNewAmmo, MEMBER_INTEGER), PL_MEMBERS(m_afPhysicsFlags, MEMBER_INTEGER), PL_MEMBERS(m_fNextSuicideTime, MEMBER_FLOAT), @@ -221,17 +254,17 @@ member_t memberlist_player[] = { PL_MEMBERS(m_flDuckTime, MEMBER_FLOAT), PL_MEMBERS(m_flWallJumpTime, MEMBER_FLOAT), PL_MEMBERS(m_flSuitUpdate, MEMBER_FLOAT), - PL_MEMBERS(m_rgSuitPlayList, MEMBER_INTEGER), // ARRAY [4] + PL_MEMBERS(m_rgSuitPlayList, MEMBER_INTEGER), PL_MEMBERS(m_iSuitPlayNext, MEMBER_INTEGER), - PL_MEMBERS(m_rgiSuitNoRepeat, MEMBER_INTEGER), // ARRAY [32] - PL_MEMBERS(m_rgflSuitNoRepeatTime, MEMBER_FLOAT), // ARRAY [32] + PL_MEMBERS(m_rgiSuitNoRepeat, MEMBER_INTEGER), + PL_MEMBERS(m_rgflSuitNoRepeatTime, MEMBER_FLOAT), PL_MEMBERS(m_lastDamageAmount, MEMBER_INTEGER), PL_MEMBERS(m_tbdPrev, MEMBER_FLOAT), PL_MEMBERS(m_flgeigerRange, MEMBER_FLOAT), PL_MEMBERS(m_flgeigerDelay, MEMBER_FLOAT), PL_MEMBERS(m_igeigerRangePrev, MEMBER_INTEGER), PL_MEMBERS(m_iStepLeft, MEMBER_INTEGER), - PL_MEMBERS(m_szTextureName, MEMBER_CHAR_ARRAY), // ARRAY [17] + PL_MEMBERS(m_szTextureName, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_chTextureType, MEMBER_BYTE), PL_MEMBERS(m_idrowndmg, MEMBER_INTEGER), PL_MEMBERS(m_idrownrestored, MEMBER_INTEGER), @@ -258,22 +291,22 @@ member_t memberlist_player[] = { PL_MEMBERS(m_pActiveItem, MEMBER_CLASSPTR), PL_MEMBERS(m_pClientActiveItem, MEMBER_CLASSPTR), PL_MEMBERS(m_pLastItem, MEMBER_CLASSPTR), - PL_MEMBERS(m_rgAmmo, MEMBER_INTEGER), // ARRAY [32] - PL_MEMBERS(m_rgAmmoLast, MEMBER_INTEGER), // ARRAY [32] + PL_MEMBERS(m_rgAmmo, MEMBER_INTEGER), + PL_MEMBERS(m_rgAmmoLast, MEMBER_INTEGER), PL_MEMBERS(m_vecAutoAim, MEMBER_VECTOR), PL_MEMBERS(m_fOnTarget, MEMBER_INTEGER), PL_MEMBERS(m_iDeaths, MEMBER_INTEGER), - PL_MEMBERS(m_izSBarState, MEMBER_INTEGER), // ARRAY [4] + PL_MEMBERS(m_izSBarState, MEMBER_INTEGER), PL_MEMBERS(m_flNextSBarUpdateTime, MEMBER_FLOAT), PL_MEMBERS(m_flStatusBarDisappearDelay, MEMBER_FLOAT), - PL_MEMBERS(m_SbarString0, MEMBER_CHAR_ARRAY), // ARRAY [128] + PL_MEMBERS(m_SbarString0, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_lastx, MEMBER_INTEGER), PL_MEMBERS(m_lasty, MEMBER_INTEGER), PL_MEMBERS(m_nCustomSprayFrames, MEMBER_INTEGER), PL_MEMBERS(m_flNextDecalTime, MEMBER_FLOAT), - PL_MEMBERS(m_szTeamName, MEMBER_CHAR_ARRAY), // ARRAY [16] + PL_MEMBERS(m_szTeamName, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_modelIndexPlayer, MEMBER_INTEGER), - PL_MEMBERS(m_szAnimExtention, MEMBER_CHAR_ARRAY), // ARRAY [32] + PL_MEMBERS(m_szAnimExtention, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_iGaitsequence, MEMBER_INTEGER), PL_MEMBERS(m_flGaitframe, MEMBER_FLOAT), PL_MEMBERS(m_flGaityaw, MEMBER_FLOAT), @@ -295,12 +328,12 @@ member_t memberlist_player[] = { PL_MEMBERS(m_blindFadeTime, MEMBER_FLOAT), PL_MEMBERS(m_blindAlpha, MEMBER_INTEGER), PL_MEMBERS(m_allowAutoFollowTime, MEMBER_FLOAT), - PL_MEMBERS(m_autoBuyString, MEMBER_CHAR_ARRAY), // ARRAY 256 + PL_MEMBERS(m_autoBuyString, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_rebuyString, MEMBER_CHAR_POINTER), PL_MEMBERS(m_rebuyStruct, MEBMER_REBUYSTRUCT), PL_MEMBERS(m_bIsInRebuy, MEMBER_BOOL), PL_MEMBERS(m_flLastUpdateTime, MEMBER_FLOAT), - PL_MEMBERS(m_lastLocation, MEMBER_CHAR_ARRAY), // ARRAY [32] + PL_MEMBERS(m_lastLocation, MEMBER_CHAR_ARRAY), PL_MEMBERS(m_progressStart, MEMBER_FLOAT), PL_MEMBERS(m_progressEnd, MEMBER_FLOAT), PL_MEMBERS(m_bObserverAutoDirector, MEMBER_BOOL), @@ -309,7 +342,7 @@ member_t memberlist_player[] = { PL_MEMBERS(m_intenseTimestamp, MEMBER_FLOAT), PL_MEMBERS(m_silentTimestamp, MEMBER_FLOAT), PL_MEMBERS(m_musicState, MEMBER_INTEGER), - PL_MEMBERS(m_flLastCommandTime, MEMBER_FLOAT), // ARRAY [8] + PL_MEMBERS(m_flLastCommandTime, MEMBER_FLOAT), }; memberlist_t memberlist; @@ -323,6 +356,8 @@ member_t *memberlist_t::operator[](size_t members) const switch (table) { CASE(gamerules) + CASE(base) + CASE(animating) CASE(player) } diff --git a/reapi/src/member_list.h b/reapi/src/member_list.h index 760ec36..2027d70 100644 --- a/reapi/src/member_list.h +++ b/reapi/src/member_list.h @@ -38,6 +38,8 @@ struct memberlist_t enum members_tables_e { ht_gamerules, + ht_base, + ht_animating, ht_player }; }; @@ -133,6 +135,46 @@ enum CSGameRules_Members m_bSkipSpawn }; +// CBasePlayer +enum CBaseEntity_Members +{ + currentammo = BEGIN_MEMBER_REGION(base), + maxammo_buckshot, + ammo_buckshot, + maxammo_9mm, + ammo_9mm, + maxammo_556nato, + ammo_556nato, + maxammo_556natobox, + ammo_556natobox, + maxammo_762nato, + ammo_762nato, + maxammo_45acp, + ammo_45acp, + maxammo_50ae, + ammo_50ae, + maxammo_338mag, + ammo_338mag, + maxammo_57mm, + ammo_57mm, + maxammo_357sig, + ammo_357sig, + m_flStartThrow, + m_flReleaseThrow, + m_iSwing, + has_disconnected, +}; + +// CBaseAnimating +enum CBaseAnimating_Members +{ + m_flFrameRate = BEGIN_MEMBER_REGION(animating), + m_flGroundSpeed, + m_flLastEventCheck, + m_fSequenceFinished, + m_fSequenceLoops, +}; + // CBasePlayer enum CBasePlayer_Members { diff --git a/reapi/src/meta_api.cpp b/reapi/src/meta_api.cpp index 52e7daa..e6ad744 100644 --- a/reapi/src/meta_api.cpp +++ b/reapi/src/meta_api.cpp @@ -11,7 +11,7 @@ plugin_info_t Plugin_info = "ReAPI", // name APP_VERSION_STRD, // version APP_VERSION_YMD_STR, // date - "s1lent", // author + "Asmodai & s1lent", // author "https://github.com/s1lentq/reapi/", // url "ReAPI", // logtag, all caps please PT_ANYTIME, // (when) loadable @@ -33,7 +33,7 @@ META_FUNCTIONS gMetaFunctionTable = { NULL, // pfnGetEntityAPI HL SDK; called before game DLL NULL, // pfnGetEntityAPI_Post META; called after game DLL - NULL, // pfnGetEntityAPI2 HL SDK2; called before game DLL + GetEntityAPI2, // pfnGetEntityAPI2 HL SDK2; called before game DLL GetEntityAPI2_Post, // pfnGetEntityAPI2_Post META; called after game DLL NULL, // pfnGetNewDLLFunctions HL SDK2; called before game DLL NULL, // pfnGetNewDLLFunctions_Post META; called after game DLL diff --git a/reapi/src/mod_regamedll_api.cpp b/reapi/src/mod_regamedll_api.cpp index f00c2df..f95d239 100644 --- a/reapi/src/mod_regamedll_api.cpp +++ b/reapi/src/mod_regamedll_api.cpp @@ -52,7 +52,6 @@ bool RegamedllApi_Init() g_ReGameFuncs = g_ReGameApi->GetFuncs(); g_ReGameHookchains = g_ReGameApi->GetHookchains(); - g_pCSGameRules = (CHalfLifeMultiplay **)g_ReGameApi->GetGameData()->GetGameRules(); return true; } \ No newline at end of file diff --git a/reapi/src/natives_hookchains.cpp b/reapi/src/natives_hookchains.cpp index 584166f..734d5ca 100644 --- a/reapi/src/natives_hookchains.cpp +++ b/reapi/src/natives_hookchains.cpp @@ -7,7 +7,7 @@ * @param function The function to hook. * @param callback The forward to call. * @param post Whether or not to forward this in post. - * @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. + * @return Returns a handle to the hook. Use EnableHookChain/DisableHookChain to toggle the forward on or off. * * native RegisterHookChain(any:function_id, const callback[], post = 0); */ @@ -51,11 +51,11 @@ static cell AMX_NATIVE_CALL RegisterHookChain(AMX *amx, cell *params) } /* - * Disable hook by handle. + * Enable hook by handle. * Use the return value from RegisterHookChain as the parameter here! * * @param fwd The hook to re-enable. - * @return Returns if the function is successful executed true otherwise false + * @return Returns if the function is successful executed true otherwise false * * native bool:EnableHookChain(any:fwd); */ @@ -72,12 +72,12 @@ static cell AMX_NATIVE_CALL EnableHookChain(AMX *amx, cell *params) return FALSE; } - hook->m_state = FSTATE_ENABLED; + hook->SetState(FSTATE_ENABLED); return TRUE; } /* - * Enable hook by handle. + * Disable hook by handle. * Use the return value from RegisterHookChain as the parameter here! * * @param fwd The hook to stop. @@ -97,7 +97,7 @@ static cell AMX_NATIVE_CALL DisableHookChain(AMX *amx, cell *params) return FALSE; } - hook->m_state = FSTATE_STOPPED; + hook->SetState(FSTATE_STOPPED); return TRUE; } @@ -164,7 +164,7 @@ static cell AMX_NATIVE_CALL SetHookChainReturn(AMX *amx, cell *params) * * @param value The value to set the return to. * @param [maxlen] Max length of string (optional) -* @return Returns if the function is successful executed true otherwise false +* @return Returns if the function is successful executed true otherwise false * * native GetHookChainReturn(AType:type, any:...); */ @@ -190,7 +190,7 @@ static cell AMX_NATIVE_CALL GetHookChainReturn(AMX *amx, cell *params) break; case ATYPE_STRING: { - if (params[arg_count] != 2) + if (PARAMS_COUNT != 2) return FALSE; setAmxString(dstAddr, retVal._string, params[arg_maxlen]); @@ -213,7 +213,7 @@ static cell AMX_NATIVE_CALL GetHookChainReturn(AMX *amx, cell *params) * @param number Number of argument * @param value New value * @param [maxlen] Max length of string (optional) -* @return Returns if the function is successful executed true otherwise false +* @return Returns if the function is successful executed true otherwise false * * native SetHookChainArg(number, AType:type, any:...); */ diff --git a/reapi/src/natives_members.cpp b/reapi/src/natives_members.cpp index 37b526b..215cdfd 100644 --- a/reapi/src/natives_members.cpp +++ b/reapi/src/natives_members.cpp @@ -3,7 +3,7 @@ // native set_member(_index, any:_member, any:...); static cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params) { - enum args_member_e { arg_count, arg_index, arg_member, arg_value, arg_elem }; + enum args_e { arg_count, arg_index, arg_member, arg_value, arg_elem }; member_t *member = memberlist[params[arg_member]]; if (member == nullptr) { @@ -13,20 +13,20 @@ static cell AMX_NATIVE_CALL set_member(AMX *amx, cell *params) edict_t *pEdict = INDEXENT(params[arg_index]); if (pEdict == nullptr || pEdict->pvPrivateData == nullptr) { - MF_LogError(amx, AMX_ERR_NATIVE, "set_member: invalid or uninitialized entity", params[arg_member]); + MF_LogError(amx, AMX_ERR_NATIVE, "set_member: invalid or uninitialized entity"); return FALSE; } cell* value = getAmxAddr(amx, params[arg_value]); - size_t element = (params[arg_count] == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0; + size_t element = (PARAMS_COUNT == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0; return set_member(pEdict->pvPrivateData, member, element, value); } -// native any:get_member(_index = 0, any:_member, any:...); +// native any:get_member(_index, any:_member, any:...); static cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params) { - enum args_member_e { arg_count, arg_index, arg_member, arg_3, arg_4 }; + enum args_e { arg_count, arg_index, arg_member, arg_3, arg_4 }; member_t *member = memberlist[params[arg_member]]; if (member == nullptr) { @@ -36,18 +36,18 @@ static cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params) edict_t *pEdict = INDEXENT(params[arg_index]); if (pEdict == nullptr || pEdict->pvPrivateData == nullptr) { - MF_LogError(amx, AMX_ERR_NATIVE, "get_member: invalid or uninitialized entity", params[arg_member]); + MF_LogError(amx, AMX_ERR_NATIVE, "get_member: invalid or uninitialized entity"); return FALSE; } cell* dest; size_t element; - if (params[arg_count] == 4) { + if (PARAMS_COUNT == 4) { dest = getAmxAddr(amx, params[arg_3]); element = *getAmxAddr(amx, params[arg_4]); } - else if (params[arg_count] == 3) { + else if (PARAMS_COUNT == 3) { cell* arg3 = getAmxAddr(amx, params[arg_3]); if (isTypeReturnable(member->type)) { @@ -70,16 +70,21 @@ static cell AMX_NATIVE_CALL get_member(AMX *amx, cell *params) // native set_member_game(any:_member, any:...); static cell AMX_NATIVE_CALL set_member_game(AMX *amx, cell *params) { - enum args_member_e { arg_count, arg_member, arg_value, arg_elem }; + enum args_e { arg_count, arg_member, arg_value, arg_elem }; member_t *member = memberlist[params[arg_member]]; if (member == nullptr) { MF_LogError(amx, AMX_ERR_NATIVE, "set_member_game: unknown member id %i", params[arg_member]); return FALSE; } - + + if (g_pCSGameRules == nullptr || *g_pCSGameRules == nullptr) { + MF_LogError(amx, AMX_ERR_NATIVE, "get_member_game: gamerules not initialized"); + return 0; + } + cell* value = getAmxAddr(amx, params[arg_value]); - size_t element = (params[arg_count] == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0; + size_t element = (PARAMS_COUNT == 4) ? *getAmxAddr(amx, params[arg_elem]) : 0; return set_member(*g_pCSGameRules, member, element, value); } @@ -87,7 +92,7 @@ static cell AMX_NATIVE_CALL set_member_game(AMX *amx, cell *params) // native get_member_game(any:_member, any:...); static cell AMX_NATIVE_CALL get_member_game(AMX *amx, cell *params) { - enum args_member_e { arg_count, arg_member, arg_3, arg_4 }; + enum args_e { arg_count, arg_member, arg_3, arg_4 }; member_t *member = memberlist[params[arg_member]]; if (member == nullptr) { @@ -95,14 +100,19 @@ static cell AMX_NATIVE_CALL get_member_game(AMX *amx, cell *params) return 0; } + if (g_pCSGameRules == nullptr || *g_pCSGameRules == nullptr) { + MF_LogError(amx, AMX_ERR_NATIVE, "get_member_game: gamerules not initialized"); + return 0; + } + cell* dest; size_t element; - - if (params[arg_count] == 4) { + + if (PARAMS_COUNT == 4) { dest = getAmxAddr(amx, params[arg_3]); element = *getAmxAddr(amx, params[arg_4]); } - else if (params[arg_count] == 3) { + else if (PARAMS_COUNT == 3) { cell* arg3 = getAmxAddr(amx, params[arg_3]); if (isTypeReturnable(member->type)) { @@ -183,18 +193,9 @@ BOOL set_member(void* pdata, const member_t *member, size_t element, cell* value case MEMBER_CHAR_POINTER: { // native set_member(_index, any:_member, const source[]); - size_t len; - char *source = getAmxString(value, &len); + char *source = getAmxString(value); char *&dest = get_member(pdata, member->offset); - - if (dest != nullptr) { - delete[] dest; - } - - dest = new char[len + 1]; - strcpy(dest, source); - - set_member(pdata, member->offset, dest); + g_ReGameFuncs->ChangeString(dest, source); return TRUE; } case MEMBER_FLOAT: diff --git a/reapi/src/natives_misc.cpp b/reapi/src/natives_misc.cpp new file mode 100644 index 0000000..2a99d75 --- /dev/null +++ b/reapi/src/natives_misc.cpp @@ -0,0 +1,189 @@ +#include "precompiled.h" + +// native rg_set_animation(index, PLAYER_ANIM:playerAnim); +static cell AMX_NATIVE_CALL rg_set_animation(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index, arg_anim }; + + ICSPlayer *pPlayer = g_ReGameFuncs->INDEX_TO_CSPLAYER(params[arg_index]); + if (pPlayer == nullptr || !pPlayer->IsConnected()) { + return FALSE; + } + + pPlayer->SetAnimation(static_cast(params[arg_anim])); + return TRUE; +} + +// native rg_add_account(index, amount, bool:bTrackChange = true); +static cell AMX_NATIVE_CALL rg_add_account(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index, arg_amount, arg_track_change }; + + ICSPlayer *pPlayer = g_ReGameFuncs->INDEX_TO_CSPLAYER(params[arg_index]); + if (pPlayer == nullptr || !pPlayer->IsConnected()) { + return FALSE; + } + + pPlayer->AddAccount(params[arg_amount], params[arg_track_change] != 0); + return TRUE; +} + +// native rg_give_item(index, const pszName[]); +static cell AMX_NATIVE_CALL rg_give_item(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index, arg_item }; + + ICSPlayer *pPlayer = g_ReGameFuncs->INDEX_TO_CSPLAYER(params[arg_index]); + + if (pPlayer == nullptr || !pPlayer->IsConnected()) { + return FALSE; + } + + const char *itemName = getAmxString(amx, params[arg_item]); + pPlayer->GiveNamedItem(itemName); + return TRUE; +} + +// native rg_give_default_items(index); +static cell AMX_NATIVE_CALL rg_give_default_items(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index }; + + ICSPlayer *pPlayer = g_ReGameFuncs->INDEX_TO_CSPLAYER(params[arg_index]); + if (pPlayer == nullptr || !pPlayer->IsConnected()) { + return FALSE; + } + + pPlayer->GiveDefaultItems(); + return TRUE; +} + +// native rg_give_shield(index, bool:bDeploy = true); +static cell AMX_NATIVE_CALL rg_give_shield(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_index, arg_deploy }; + + ICSPlayer *pPlayer = g_ReGameFuncs->INDEX_TO_CSPLAYER(params[arg_index]); + if (pPlayer == nullptr || !pPlayer->IsConnected()) { + return FALSE; + } + + pPlayer->GiveShield(params[arg_deploy] != 0); + return TRUE; +} + +// native rg_dmg_radius(Float:vecSrc[3], inflictor, attacker, Float:flDamage, Float:flRadius, iClassIgnore, bitsDamageType); +static cell AMX_NATIVE_CALL rg_dmg_radius(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_vec, arg_inflictor, arg_attacker, arg_damage, arg_radius, arg_ignore_class, arg_dmg_type }; + + cell *pSrc = getAmxAddr(amx, params[arg_vec]); + + entvars_t *pevInflictor = VARS(INDEXENT(params[arg_inflictor])); + entvars_t *pevAttacker = VARS(INDEXENT(params[arg_attacker])); + + Vector vecSrc(*(float *)&pSrc[0], *(float *)&pSrc[1], *(float *)&pSrc[2]); + g_ReGameFuncs->RadiusDamage(vecSrc, pevInflictor, pevAttacker, *(float *)¶ms[arg_damage], *(float *)¶ms[arg_radius], params[arg_ignore_class], params[arg_dmg_type]); + return TRUE; +} + +// native rg_multidmg_clear(); +static cell AMX_NATIVE_CALL rg_multidmg_clear(AMX *amx, cell *params) +{ + g_ReGameFuncs->ClearMultiDamage(); + return TRUE; +} + +// native rg_multidmg_apply(inflictor, attacker); +static cell AMX_NATIVE_CALL rg_multidmg_apply(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_inflictor, arg_attacker }; + + entvars_t *pevInflictor = VARS(INDEXENT(params[arg_inflictor])); + entvars_t *pevAttacker = VARS(INDEXENT(params[arg_attacker])); + + g_ReGameFuncs->ApplyMultiDamage(pevInflictor, pevAttacker); + return TRUE; +} + +// native rg_multidmg_add(inflictor, victim, Float:flDamage, bitsDamageType); +static cell AMX_NATIVE_CALL rg_multidmg_add(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_inflictor, arg_victim, arg_damage, arg_dmg_type }; + + entvars_t *pevInflictor = VARS(INDEXENT(params[arg_inflictor])); + CBaseEntity *pVictim = g_ReGameFuncs->UTIL_PlayerByIndex(params[arg_inflictor]); + + if (pVictim == nullptr) { + return FALSE; + } + + g_ReGameFuncs->AddMultiDamage(pevInflictor, pVictim, *(float *)¶ms[arg_damage], params[arg_dmg_type]); + return TRUE; +} + +// native rg_fire_bullets(inflictor, attacker, shots, Float:vecSrc[3], Float:vecDirShooting[3], Float::vecSpread[3], Float:flDistance, iBulletType, iTracerFreq, iDamage); +static cell AMX_NATIVE_CALL rg_fire_bullets(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_inflictor, arg_attacker, arg_shots, arg_vecSrc, arg_dir, arg_spread, arg_dist, arg_bullet_type, arg_tracefrq, arg_dmg }; + + ICSEntity *pInflictor = g_ReGameFuncs->INDEX_TO_CSENTITY(params[arg_inflictor]); + + cell *pSrc = getAmxAddr(amx, params[arg_vecSrc]); + Vector vecSrc(*(float *)&pSrc[0], *(float *)&pSrc[1], *(float *)&pSrc[2]); + + cell *pDir = getAmxAddr(amx, params[arg_dir]); + Vector vecDirShooting(*(float *)&pDir[0], *(float *)&pDir[1], *(float *)&pDir[2]); + + cell *pSpread = getAmxAddr(amx, params[arg_spread]); + Vector vecSpread(*(float *)&pSpread[0], *(float *)&pSpread[1], *(float *)&pSpread[2]); + + entvars_t *pevAttacker = VARS(INDEXENT(params[arg_attacker])); + pInflictor->FireBullets(params[arg_shots], vecSrc, vecDirShooting, vecSpread, *(float *)¶ms[arg_dist], params[arg_bullet_type], params[arg_tracefrq], params[arg_dmg], pevAttacker); + return TRUE; +} + +// native Float:[3] rg_fire_bullets3(inflictor, attacker, Float:vecSrc[3], Float:vecDirShooting[3], Float:vecSpread, Float:flDistance, iPenetration, iBulletType, iDamage, Float:flRangeModifier, bool:bPistol, shared_rand); +static cell AMX_NATIVE_CALL rg_fire_bullets3(AMX *amx, cell *params) +{ + enum args_e { arg_count, arg_inflictor, arg_attacker, arg_vecSrc, arg_dir, arg_spread, arg_dist, arg_penetration, arg_bullet_type, arg_dmg, arg_range_mod, arg_pistol, arg_rand, arg_out }; + + ICSEntity *pInflictor = g_ReGameFuncs->INDEX_TO_CSENTITY(params[arg_inflictor]); + + cell *pSrc = getAmxAddr(amx, params[arg_vecSrc]); + Vector vecSrc(*(float *)&pSrc[0], *(float *)&pSrc[1], *(float *)&pSrc[2]); + + cell *pDir = getAmxAddr(amx, params[arg_dir]); + Vector vecDirShooting(*(float *)&pDir[0], *(float *)&pDir[1], *(float *)&pDir[2]); + + entvars_t *pevAttacker = VARS(INDEXENT(params[arg_attacker])); + + Vector *pOut = (Vector *)getAmxAddr(amx, params[arg_out]); + *pOut = pInflictor->FireBullets3(vecSrc, vecDirShooting, *(float *)¶ms[arg_spread], *(float *)¶ms[arg_dist], params[arg_penetration], params[arg_bullet_type], params[arg_dmg], *(float *)¶ms[arg_range_mod], pevAttacker, params[arg_pistol] != 0, params[arg_rand]); + + return TRUE; +} + +AMX_NATIVE_INFO Misc_Natives[] = +{ + { "rg_set_animation", rg_set_animation }, + { "rg_add_account", rg_add_account }, + { "rg_give_item", rg_give_item }, + { "rg_give_default_items", rg_give_default_items }, + { "rg_give_shield", rg_give_shield }, + + { "rg_dmg_radius", rg_dmg_radius }, + { "rg_multidmg_clear", rg_multidmg_clear }, + { "rg_multidmg_apply", rg_multidmg_apply }, + { "rg_multidmg_add", rg_multidmg_add }, + + { "rg_fire_bullets", rg_fire_bullets }, + { "rg_fire_bullets3", rg_fire_bullets3 }, + + { nullptr, nullptr } +}; + +void RegisterNatives_Misc() +{ + g_amxxapi.AddNatives(Misc_Natives); +} diff --git a/reapi/src/natives_misc.h b/reapi/src/natives_misc.h new file mode 100644 index 0000000..9272719 --- /dev/null +++ b/reapi/src/natives_misc.h @@ -0,0 +1,3 @@ +#pragma once + +void RegisterNatives_Misc(); diff --git a/reapi/src/precompiled.h b/reapi/src/precompiled.h index 3877e92..f25eb68 100644 --- a/reapi/src/precompiled.h +++ b/reapi/src/precompiled.h @@ -38,6 +38,7 @@ #include "member_list.h" #include "natives_hookchains.h" #include "natives_members.h" +#include "natives_misc.h" #undef DLLEXPORT #ifdef _WIN32 diff --git a/reapi/src/reapi_const.inc b/reapi/src/reapi_const.inc index 16c7a3b..123a80b 100644 --- a/reapi/src/reapi_const.inc +++ b/reapi/src/reapi_const.inc @@ -4,5 +4,5 @@ #define _reapi_const_included // reapi version -#define REAPI_VERISON_MAJOR 1 +#define REAPI_VERISON_MAJOR 2 #define REAPI_VERISON_MINOR 0