- SW: Clean up some Q16.16 angle usage within DoPlayerTurnTurret().

This commit is contained in:
Mitchell Richters 2020-11-26 17:30:45 +11:00
parent 80ff918b17
commit 00ce61959c

View file

@ -1611,7 +1611,7 @@ DoPlayerTurnVehicleRect(PLAYERp pp, int *x, int *y, int *ox, int *oy)
void void
DoPlayerTurnTurret(PLAYERp pp, float avel) DoPlayerTurnTurret(PLAYERp pp, float avel)
{ {
fixed_t diff; lookangle diff;
binangle new_ang; binangle new_ang;
SECTOR_OBJECTp sop = pp->sop; SECTOR_OBJECTp sop = pp->sop;
@ -1633,11 +1633,11 @@ DoPlayerTurnTurret(PLAYERp pp, float avel)
if (sop->limit_ang_center >= 0) if (sop->limit_ang_center >= 0)
{ {
diff = getincangleq16(IntToFixed(sop->limit_ang_center), new_ang.asq16()); diff = getincanglebam(buildang(sop->limit_ang_center), new_ang);
if (labs(diff) >= IntToFixed(sop->limit_ang_delta)) if (labs(diff.asbuild()) >= sop->limit_ang_delta)
{ {
if (diff < 0) if (diff.asbam() < 0)
new_ang = buildang(sop->limit_ang_center - sop->limit_ang_delta); new_ang = buildang(sop->limit_ang_center - sop->limit_ang_delta);
else else
new_ang = buildang(sop->limit_ang_center + sop->limit_ang_delta); new_ang = buildang(sop->limit_ang_center + sop->limit_ang_delta);