Extra tiny logic fixes; swinging chains are smoother, and polyobjects can follow single-waypoint sequences

This commit is contained in:
RedEnchilada 2015-04-06 11:23:08 -05:00
parent 1078be3c30
commit 210279625a
2 changed files with 6 additions and 2 deletions

View file

@ -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));

View file

@ -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;