mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-10 06:42:21 +00:00
Merge pull request #37 from BjossiAlfreds/mysterymove
Fixed entities mysteriously teleporting to another location
This commit is contained in:
commit
f24de8d323
1 changed files with 7 additions and 1 deletions
|
@ -1205,6 +1205,7 @@ G_RunEntity(edict_t *ent)
|
|||
{
|
||||
trace_t trace;
|
||||
vec3_t previous_origin;
|
||||
qboolean saved_origin;
|
||||
|
||||
if (!ent)
|
||||
{
|
||||
|
@ -1214,6 +1215,11 @@ G_RunEntity(edict_t *ent)
|
|||
if (ent->movetype == MOVETYPE_STEP)
|
||||
{
|
||||
VectorCopy(ent->s.origin, previous_origin);
|
||||
saved_origin = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
saved_origin = false;
|
||||
}
|
||||
|
||||
if (ent->prethink)
|
||||
|
@ -1249,7 +1255,7 @@ G_RunEntity(edict_t *ent)
|
|||
gi.error("SV_Physics: bad movetype %i", (int)ent->movetype);
|
||||
}
|
||||
|
||||
if (ent->movetype == MOVETYPE_STEP)
|
||||
if (saved_origin)
|
||||
{
|
||||
/* if we moved, check and fix origin if needed */
|
||||
if (!VectorCompare(ent->s.origin, previous_origin))
|
||||
|
|
Loading…
Reference in a new issue