SV_PerformLoad: Saner check for if we can call Destroy()...

This commit is contained in:
Marco Cawthorne 2024-03-04 19:55:30 -08:00
parent 32a36d8017
commit 0c2db7a23a
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 4 additions and 4 deletions

View File

@ -705,8 +705,8 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
#ifdef REEDICT #ifdef REEDICT
while ((e=nextent(e))) { while ((e=nextent(e))) {
if (edict_num(1) != e) if (edict_num(1) != e)
NSEntity toRemove = (NSEntity)e; if (e.identity) {
if (toRemove.Destroy) { NSEntity toRemove = (NSEntity)e;
toRemove.Destroy(); toRemove.Destroy();
} else { } else {
remove(e); remove(e);
@ -753,9 +753,9 @@ SV_PerformLoad(float fh, float entcount, float playerslots)
loadent = (NSEntity)e; loadent = (NSEntity)e;
self = eold; self = eold;
} else { } else {
NSEntity toRemove = (NSEntity)e;
NSError("Could not spawn %s", cname); NSError("Could not spawn %s", cname);
if (toRemove.Destroy) { if (e.identity) {
NSEntity toRemove = (NSEntity)e;
toRemove.Destroy(); toRemove.Destroy();
} else { } else {
remove(e); remove(e);