mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-10 11:58:37 +00:00
Fix crash when accessing gamerules during mapchange (#593)
If the gamerules proxy entity doesn't exist, don't try to generate the reference for it.
This commit is contained in:
parent
369e95f6d2
commit
761cbf9a8a
@ -70,6 +70,7 @@ static CBaseEntity* GetGameRulesProxyEnt()
|
|||||||
if (proxyEntRef == -1 || (pProxy = gamehelpers->ReferenceToEntity(proxyEntRef)) == NULL)
|
if (proxyEntRef == -1 || (pProxy = gamehelpers->ReferenceToEntity(proxyEntRef)) == NULL)
|
||||||
{
|
{
|
||||||
pProxy = FindEntityByNetClass(playerhelpers->GetMaxClients(), g_szGameRulesProxy);
|
pProxy = FindEntityByNetClass(playerhelpers->GetMaxClients(), g_szGameRulesProxy);
|
||||||
|
if (pProxy)
|
||||||
proxyEntRef = gamehelpers->EntityToReference(pProxy);
|
proxyEntRef = gamehelpers->EntityToReference(pProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user