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
89c4be525b
commit
0961e5dde3
@ -70,7 +70,8 @@ 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);
|
||||||
proxyEntRef = gamehelpers->EntityToReference(pProxy);
|
if (pProxy)
|
||||||
|
proxyEntRef = gamehelpers->EntityToReference(pProxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pProxy;
|
return pProxy;
|
||||||
|
Loading…
Reference in New Issue
Block a user