mirror of
https://github.com/s1lentq/ReGameDLL_CS.git
synced 2025-01-14 23:58:06 +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()
|
void UTIL_ResetEntities()
|
||||||
{
|
{
|
||||||
edict_t *pEdict = INDEXENT(1);
|
for (int i = 1; i < gpGlobals->maxEntities; i++)
|
||||||
for (int i = 1; i < gpGlobals->maxEntities; i++, pEdict++)
|
|
||||||
{
|
{
|
||||||
if (pEdict->free)
|
edict_t *pEdict = INDEXENT(i);
|
||||||
|
if (!pEdict || pEdict->free)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
CBaseEntity *pEntity = CBaseEntity::Instance(pEdict);
|
CBaseEntity *pEntity = CBaseEntity::Instance(pEdict);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user