Add A2S_Rules fix for CS:GO to CStrike extension. (#614)

* Add A2S_Rules fix for CS:GO to CStrike extension.

* Dont force set the cvar. Add checks before patching.

* Remove incorrect and useless check.

* Remove checking value as it is in the signature.

* Update build script changes to AMBuild 2.1 API to fix build.

* Fix bad check and ConVarRef being resolved too early.

* Whoops. This line is kinda important. Got nuked when refactoring.

* Remove unused variable.

* Updatet gamedata.

* Switch to "Addresses" gamedata lookup

* Add linux64 gamedata

* Fix mac build

Co-authored-by: Ruben Gonzalez <[email protected]>
Co-authored-by: Peace-Maker <[email protected]>
This commit is contained in:
Nicholas Hastings
2021-03-08 22:42:32 +00:00
committed by GitHub
co-authored by Ruben Gonzalez Peace-Maker
parent 6c2be9bdcc
commit ae485c3115
6 changed files with 377 additions and 3 deletions
+14
View File
@@ -36,6 +36,9 @@
#include "iplayerinfo.h"
#include "ISDKTools.h"
#include "forwards.h"
#if SOURCE_ENGINE == SE_CSGO
#include "rulesfix.h"
#endif
#include "util_cstrike.h"
/**
@@ -88,6 +91,10 @@ bool CStrike::SDK_OnLoad(char *error, size_t maxlength, bool late)
playerhelpers->RegisterCommandTargetProcessor(this);
#if SOURCE_ENGINE == SE_CSGO
rulesfix.OnLoad();
#endif
CDetourManager::Init(g_pSM->GetScriptingEngine(), g_pGameConf);
g_pHandleBuyForward = forwards->CreateForward("CS_OnBuyCommand", ET_Event, 2, NULL, Param_Cell, Param_String);
@@ -110,6 +117,12 @@ bool CStrike::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool
GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER);
gpGlobals = ismm->GetCGlobals();
#if SOURCE_ENGINE == SE_CSGO
ICvar *icvar;
GET_V_IFACE_CURRENT(GetEngineFactory, icvar, ICvar, CVAR_INTERFACE_VERSION);
g_pCVar = icvar;
#endif
return true;
}
@@ -153,6 +166,7 @@ void CStrike::SDK_OnUnload()
forwards->ReleaseForward(g_pCSWeaponDropForward);
#if SOURCE_ENGINE == SE_CSGO
rulesfix.OnUnload();
ClearHashMaps();
#endif
}