mirror of
https://github.com/rehlds/reapi.git
synced 2024-12-28 15:45:31 +03:00
Fix to get first edict (part 2)
This commit is contained in:
parent
61460e962b
commit
33f85c765a
@ -9,7 +9,7 @@ DLL_FUNCTIONS gFunctionTable =
|
||||
NULL, // pfnUse
|
||||
NULL, // pfnTouch
|
||||
NULL, // pfnBlocked
|
||||
NULL, // pfnKeyValue
|
||||
&KeyValue, // pfnKeyValue
|
||||
NULL, // pfnSave
|
||||
NULL, // pfnRestore
|
||||
NULL, // pfnSetAbsBox
|
||||
|
@ -59,10 +59,20 @@ void ServerDeactivate_Post()
|
||||
api_cfg.ServerDeactivate();
|
||||
g_hookManager.clearHandlers();
|
||||
g_pFunctionTable->pfnSpawn = DispatchSpawn;
|
||||
g_pFunctionTable->pfnKeyValue = KeyValue;
|
||||
|
||||
SET_META_RESULT(MRES_IGNORED);
|
||||
}
|
||||
|
||||
void KeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd)
|
||||
{
|
||||
// get the first edict worldspawn
|
||||
if (FClassnameIs(pentKeyvalue, "worldspawn")) {
|
||||
g_pEdicts = pentKeyvalue;
|
||||
g_pFunctionTable->pfnKeyValue = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
CGameRules *InstallGameRules(IReGameHook_InstallGameRules *chain)
|
||||
{
|
||||
return g_pGameRules = chain->callNext();
|
||||
|
@ -17,5 +17,6 @@ void ServerActivate_Post(edict_t *pEdictList, int edictCount, int clientMax);
|
||||
void ServerDeactivate_Post();
|
||||
int DispatchSpawn(edict_t* pEntity);
|
||||
void ResetGlobalState();
|
||||
void KeyValue(edict_t *pentKeyvalue, KeyValueData *pkvd);
|
||||
|
||||
CGameRules *InstallGameRules(IReGameHook_InstallGameRules *chain);
|
||||
|
Loading…
Reference in New Issue
Block a user