mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-13 23:28:04 +03:00
UTIL_ResetEntities: Crash fixed, sometimes returns NULL for 1 index
This commit is contained in:
parent
21dab90571
commit
10813019c8
@ -1502,10 +1502,10 @@ void UTIL_RestartOther(const char *szClassname)
|
||||
|
||||
void UTIL_ResetEntities()
|
||||
{
|
||||
edict_t *pEdict = INDEXENT(1);
|
||||
for (int i = 1; i < gpGlobals->maxEntities; i++, pEdict++)
|
||||
for (int i = 1; i < gpGlobals->maxEntities; i++)
|
||||
{
|
||||
if (pEdict->free)
|
||||
edict_t *pEdict = INDEXENT(i);
|
||||
if (!pEdict || pEdict->free)
|
||||
continue;
|
||||
|
||||
CBaseEntity *pEntity = CBaseEntity::Instance(pEdict);
|
||||
|
Loading…
x
Reference in New Issue
Block a user