From f25c9104dbe84c707f6322580ed13e3b02ae892d Mon Sep 17 00:00:00 2001 From: s1lentq Date: Thu, 24 Aug 2023 17:22:10 +0700 Subject: [PATCH] Update CSSDK --- reapi/include/cssdk/dlls/API/CSEntity.h | 24 +++++++++++++++--------- reapi/include/cssdk/dlls/cbase.h | 6 ++++++ reapi/src/mods/mod_regamedll_api.cpp | 6 ++++++ 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/reapi/include/cssdk/dlls/API/CSEntity.h b/reapi/include/cssdk/dlls/API/CSEntity.h index 1e9ca2b9..ad4dfd2f 100644 --- a/reapi/include/cssdk/dlls/API/CSEntity.h +++ b/reapi/include/cssdk/dlls/API/CSEntity.h @@ -43,9 +43,14 @@ class CCSEntity virtual void FireBuckshots(ULONG cShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, 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; +public: + CBaseEntity *m_pContainingEntity; + +private: #if defined(_MSC_VER) -#pragma region reserve_vfuncs_Region +#pragma region reserve_data_Region #endif + int CCSEntity_Reserve[0x1000]; virtual void func_reserve1() {}; virtual void func_reserve2() {}; virtual void func_reserve3() {}; @@ -79,37 +84,38 @@ class CCSEntity #if defined(_MSC_VER) #pragma endregion #endif - -public: - CBaseEntity *m_pContainingEntity; }; class CCSDelay: public CCSEntity { - DECLARE_CLASS_TYPES(CCSDelay, CCSEntity); public: +private: + int CCSDelay_Reserve[0x100]; }; class CCSAnimating: public CCSDelay { - DECLARE_CLASS_TYPES(CCSAnimating, CCSDelay); public: +private: + int CCSAnimating_Reserve[0x100]; }; class CCSToggle: public CCSAnimating { - DECLARE_CLASS_TYPES(CCSToggle, CCSAnimating); public: +private: + int CCSToggle_Reserve[0x100]; }; class CCSMonster: public CCSToggle { - DECLARE_CLASS_TYPES(CCSMonster, CCSToggle); public: +private: + int CCSMonster_Reserve[0x100]; }; -#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION002" +#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION003" diff --git a/reapi/include/cssdk/dlls/cbase.h b/reapi/include/cssdk/dlls/cbase.h index 53d4a031..96731bbd 100644 --- a/reapi/include/cssdk/dlls/cbase.h +++ b/reapi/include/cssdk/dlls/cbase.h @@ -173,6 +173,7 @@ class CBaseEntity public: CCSEntity *m_pEntity; // NOTE: it was replaced on member "int *current_ammo" because it is useless. + CCSEntity *CSEntity() const; // We use this variables to store each ammo count. float currentammo; @@ -253,6 +254,11 @@ inline void CBaseEntity::SetBlocked(std::nullptr_t) m_pfnBlocked = nullptr; } +inline CCSEntity *CBaseEntity::CSEntity() const +{ + return m_pEntity; +} + class CPointEntity: public CBaseEntity { DECLARE_CLASS_TYPES(CPointEntity, CBaseEntity); diff --git a/reapi/src/mods/mod_regamedll_api.cpp b/reapi/src/mods/mod_regamedll_api.cpp index c7810f78..bd7051e2 100644 --- a/reapi/src/mods/mod_regamedll_api.cpp +++ b/reapi/src/mods/mod_regamedll_api.cpp @@ -62,6 +62,12 @@ bool RegamedllApi_Init() if (!g_ReGameApi->BGetICSEntity(CSENTITY_API_INTERFACE_VERSION)) { UTIL_ServerPrint("[%s]: Interface CCSEntity API version '%s' not found.\n", Plugin_info.logtag, CSENTITY_API_INTERFACE_VERSION); + + if (g_ReGameApi->BGetICSEntity("CSENTITY_API_INTERFACE_VERSION002")) + UTIL_ServerPrint("[%s]: Please update ReGameDLL to the latest version.\n", Plugin_info.logtag); + else + UTIL_ServerPrint("[%s]: Please update ReAPI to the latest version.\n", Plugin_info.logtag); + return false; }