Added check for inuse to G_RunEntity that was missing but necessary

This commit is contained in:
BjossiAlfreds 2019-10-03 18:18:29 +00:00
parent ab53f4d422
commit 4c8d063a55

View file

@ -1255,10 +1255,9 @@ G_RunEntity(edict_t *ent)
gi.error("SV_Physics: bad movetype %i", (int)ent->movetype); gi.error("SV_Physics: bad movetype %i", (int)ent->movetype);
} }
if (saved_origin)
{
/* if we moved, check and fix origin if needed */ /* if we moved, check and fix origin if needed */
if (!VectorCompare(ent->s.origin, previous_origin)) /* also check inuse since entities are very often freed while thinking */
if (saved_origin && ent->inuse && !VectorCompare(ent->s.origin, previous_origin))
{ {
trace = gi.trace(ent->s.origin, ent->mins, ent->maxs, trace = gi.trace(ent->s.origin, ent->mins, ent->maxs,
previous_origin, ent, MASK_MONSTERSOLID); previous_origin, ent, MASK_MONSTERSOLID);
@ -1269,7 +1268,6 @@ G_RunEntity(edict_t *ent)
} }
} }
} }
}
/* /*
* Toss, bounce, and fly movement. When on ground and * Toss, bounce, and fly movement. When on ground and