mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-10 06:42:21 +00:00
Added check for inuse to G_RunEntity that was missing but necessary
This commit is contained in:
parent
ab53f4d422
commit
4c8d063a55
1 changed files with 8 additions and 10 deletions
18
src/g_phys.c
18
src/g_phys.c
|
@ -1255,18 +1255,16 @@ G_RunEntity(edict_t *ent)
|
|||
gi.error("SV_Physics: bad movetype %i", (int)ent->movetype);
|
||||
}
|
||||
|
||||
if (saved_origin)
|
||||
/* if we moved, check and fix origin if needed */
|
||||
/* also check inuse since entities are very often freed while thinking */
|
||||
if (saved_origin && ent->inuse && !VectorCompare(ent->s.origin, previous_origin))
|
||||
{
|
||||
/* if we moved, check and fix origin if needed */
|
||||
if (!VectorCompare(ent->s.origin, previous_origin))
|
||||
{
|
||||
trace = gi.trace(ent->s.origin, ent->mins, ent->maxs,
|
||||
previous_origin, ent, MASK_MONSTERSOLID);
|
||||
trace = gi.trace(ent->s.origin, ent->mins, ent->maxs,
|
||||
previous_origin, ent, MASK_MONSTERSOLID);
|
||||
|
||||
if (trace.allsolid || trace.startsolid)
|
||||
{
|
||||
VectorCopy(previous_origin, ent->s.origin);
|
||||
}
|
||||
if (trace.allsolid || trace.startsolid)
|
||||
{
|
||||
VectorCopy(previous_origin, ent->s.origin);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue