From 28fe32e5144ed8bbcd64c843bbafecd337abdc65 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 | 20 +++++++++++++++----- reapi/include/cssdk/dlls/cbase.h | 6 ++++++ reapi/src/mods/mod_regamedll_api.cpp | 6 ++++++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/reapi/include/cssdk/dlls/API/CSEntity.h b/reapi/include/cssdk/dlls/API/CSEntity.h index 1e9ca2b..8f03b7c 100644 --- a/reapi/include/cssdk/dlls/API/CSEntity.h +++ b/reapi/include/cssdk/dlls/API/CSEntity.h @@ -43,9 +43,14 @@ public: 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,9 +84,6 @@ public: #if defined(_MSC_VER) #pragma endregion #endif - -public: - CBaseEntity *m_pContainingEntity; }; class CCSDelay: public CCSEntity @@ -89,6 +91,8 @@ class CCSDelay: public CCSEntity DECLARE_CLASS_TYPES(CCSDelay, CCSEntity); public: +private: + int CCSDelay_Reserve[0x100]; }; class CCSAnimating: public CCSDelay @@ -96,6 +100,8 @@ class CCSAnimating: public CCSDelay DECLARE_CLASS_TYPES(CCSAnimating, CCSDelay); public: +private: + int CCSAnimating_Reserve[0x100]; }; class CCSToggle: public CCSAnimating @@ -103,6 +109,8 @@ class CCSToggle: public CCSAnimating DECLARE_CLASS_TYPES(CCSToggle, CCSAnimating); public: +private: + int CCSToggle_Reserve[0x100]; }; class CCSMonster: public CCSToggle @@ -110,6 +118,8 @@ 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 53d4a03..96731bb 100644 --- a/reapi/include/cssdk/dlls/cbase.h +++ b/reapi/include/cssdk/dlls/cbase.h @@ -173,6 +173,7 @@ public: 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 c7810f7..bd7051e 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; }