mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
Fix unintended rounding issue with hexen2's movechain stuff that was preventing origin changes.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5774 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
155ef1f460
commit
524fdb3dfd
1 changed files with 4 additions and 3 deletions
|
@ -2104,18 +2104,19 @@ static void WPhys_WalkMove (world_t *w, wedict_t *ent, const float *gravitydir)
|
|||
#ifdef HEXEN2
|
||||
void WPhys_MoveChain(world_t *w, wedict_t *ent, wedict_t *movechain, float *initial_origin, float *initial_angle)
|
||||
{
|
||||
qboolean orgchanged;
|
||||
qboolean orgunchanged;
|
||||
vec3_t moveorg, moveang;
|
||||
VectorSubtract(ent->v->origin, initial_origin, moveorg);
|
||||
VectorSubtract(ent->v->angles, initial_angle, moveang);
|
||||
if ((orgchanged=DotProduct(moveorg,moveorg)) || DotProduct(moveang,moveang))
|
||||
orgunchanged=!DotProduct(moveorg,moveorg);
|
||||
if (!orgunchanged || DotProduct(moveang,moveang))
|
||||
{
|
||||
int i;
|
||||
for(i=16; i && movechain != w->edicts && !ED_ISFREE(movechain); i--, movechain = PROG_TO_WEDICT(w->progs, movechain->xv->movechain))
|
||||
{
|
||||
if ((int)movechain->v->flags & FL_MOVECHAIN_ANGLE)
|
||||
VectorAdd(movechain->v->angles, moveang, movechain->v->angles); //FIXME: axial only
|
||||
if (orgchanged)
|
||||
if (!orgunchanged)
|
||||
{
|
||||
VectorAdd(movechain->v->origin, moveorg, movechain->v->origin);
|
||||
World_LinkEdict(w, movechain, false);
|
||||
|
|
Loading…
Reference in a new issue