ReGameDLL API: Implement BGetICSEntity/BGetIGameRules for check safe version interface.

This commit is contained in:
s1lent 2019-08-29 23:08:24 +07:00
parent 69250cf2c1
commit 96938aec55
No known key found for this signature in database
GPG Key ID: 0FE401DC73916B5C
5 changed files with 34 additions and 1 deletions

View File

@ -204,6 +204,26 @@ AmmoInfo *CReGameApi::GetAmmoInfo(AmmoType ammoID) { return &CBasePlayerItem::m_
AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(AmmoType ammoID) { return ::GetAmmoInfo(ammoID); } AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(AmmoType ammoID) { return ::GetAmmoInfo(ammoID); }
AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(const char *ammoName) { return ::GetAmmoInfo(ammoName); } AmmoInfoStruct *CReGameApi::GetAmmoInfoEx(const char *ammoName) { return ::GetAmmoInfo(ammoName); }
bool CReGameApi::BGetICSEntity(const char *pchVersion) const
{
if (!Q_stricmp(pchVersion, CSENTITY_API_INTERFACE_VERSION))
{
return true;
}
return false;
}
bool CReGameApi::BGetIGameRules(const char *pchVersion) const
{
if (!Q_stricmp(pchVersion, GAMERULES_API_INTERFACE_VERSION))
{
return true;
}
return false;
}
EXT_FUNC void Regamedll_ChangeString_api(char *&dest, const char *source) EXT_FUNC void Regamedll_ChangeString_api(char *&dest, const char *source)
{ {
size_t len = Q_strlen(source); size_t len = Q_strlen(source);

View File

@ -781,6 +781,8 @@ public:
EXT_FUNC virtual AmmoInfo *GetAmmoInfo(AmmoType ammoID); EXT_FUNC virtual AmmoInfo *GetAmmoInfo(AmmoType ammoID);
EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID); EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID);
EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName); EXT_FUNC virtual AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName);
EXT_FUNC virtual bool BGetICSEntity(const char *pchVersion) const;
EXT_FUNC virtual bool BGetIGameRules(const char *pchVersion) const;
}; };
void Regamedll_ChangeString_api(char *&dest, const char *source); void Regamedll_ChangeString_api(char *&dest, const char *source);

View File

@ -337,6 +337,8 @@ public:
bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver) bool m_bGameOver; // intermission or finale (deprecated name g_fGameOver)
}; };
#define GAMERULES_API_INTERFACE_VERSION "GAMERULES_API_INTERFACE_VERSION001"
// CHalfLifeRules - rules for the single player Half-Life game. // CHalfLifeRules - rules for the single player Half-Life game.
class CHalfLifeRules: public CGameRules class CHalfLifeRules: public CGameRules
{ {

View File

@ -32,6 +32,11 @@ class CBaseEntity;
class CCSEntity class CCSEntity
{ {
public: public:
CCSEntity() :
m_pContainingEntity(nullptr)
{
}
virtual ~CCSEntity() {} virtual ~CCSEntity() {}
virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker); virtual void FireBullets(int iShots, Vector &vecSrc, Vector &vecDirShooting, Vector &vecSpread, float flDistance, int iBulletType, int iTracerFreq, int iDamage, entvars_t *pevAttacker);
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); 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);
@ -63,3 +68,5 @@ class CCSMonster: public CCSToggle
public: public:
}; };
#define CSENTITY_API_INTERFACE_VERSION "CSENTITY_API_INTERFACE_VERSION001"

View File

@ -38,7 +38,7 @@
#include <API/CSInterfaces.h> #include <API/CSInterfaces.h>
#define REGAMEDLL_API_VERSION_MAJOR 5 #define REGAMEDLL_API_VERSION_MAJOR 5
#define REGAMEDLL_API_VERSION_MINOR 10 #define REGAMEDLL_API_VERSION_MINOR 11
// CBasePlayer::Spawn hook // CBasePlayer::Spawn hook
typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn; typedef IHookChainClass<void, class CBasePlayer> IReGameHook_CBasePlayer_Spawn;
@ -589,6 +589,8 @@ public:
virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0; virtual struct AmmoInfo *GetAmmoInfo(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0; virtual struct AmmoInfoStruct *GetAmmoInfoEx(AmmoType ammoID) = 0;
virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0; virtual struct AmmoInfoStruct *GetAmmoInfoEx(const char *ammoName) = 0;
virtual bool BGetICSEntity(const char *pchVersion) const = 0;
virtual bool BGetIGameRules(const char *pchVersion) const = 0;
}; };
#define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001" #define VRE_GAMEDLL_API_VERSION "VRE_GAMEDLL_API_VERSION001"