From 210279625a3b96250196ee7186372b9b8f8aa982 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Mon, 6 Apr 2015 11:23:08 -0500 Subject: [PATCH] Extra tiny logic fixes; swinging chains are smoother, and polyobjects can follow single-waypoint sequences --- src/p_enemy.c | 4 ++-- src/p_polyobj.c | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index ee244d3cc..8b7af9318 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -5024,7 +5024,7 @@ void A_MaceRotate(mobj_t *actor) actor->movecount += actor->target->lastlook; actor->movecount &= FINEMASK; - actor->threshold = FixedMul(FINECOSINE(actor->movecount), actor->target->lastlook); + actor->threshold = FixedMul(FINECOSINE(actor->movecount), actor->target->lastlook << FRACBITS); v[0] = FRACUNIT; v[1] = 0; @@ -5032,7 +5032,7 @@ void A_MaceRotate(mobj_t *actor) v[3] = FRACUNIT; // Calculate the angle matrixes for the link. - res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->threshold << FRACBITS))); + res = VectorMatrixMultiply(v, *RotateXMatrix(FixedAngle(actor->threshold))); M_Memcpy(&v, res, sizeof(v)); res = VectorMatrixMultiply(v, *RotateZMatrix(actor->target->health << ANGLETOFINESHIFT)); M_Memcpy(&v, res, sizeof(v)); diff --git a/src/p_polyobj.c b/src/p_polyobj.c index bec59ae2f..759eac37e 100644 --- a/src/p_polyobj.c +++ b/src/p_polyobj.c @@ -2491,6 +2491,10 @@ INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata) return 0; } + // Hotfix to not crash on single-waypoint sequences -Red + if (!last) + last = first; + // Set diffx, diffy, diffz // Put these at 0 for now...might not be needed after all. th->diffx = 0;//first->x - po->centerPt.x;