- SW: Make better use of some TAngle backend utilities.

This commit is contained in:
Mitchell Richters 2022-08-27 22:00:58 +10:00 committed by Christoph Oelckers
parent 13ea55b4cb
commit 782fb08209
3 changed files with 3 additions and 3 deletions

View file

@ -1101,7 +1101,7 @@ void CameraView(PLAYER* pp, int *tx, int *ty, int *tz, sectortype** tsect, DAngl
while (auto actor = it.Next())
{
ang = VecToAngle(*tx - actor->int_pos().X, *ty - actor->int_pos().Y);
ang_test = (DAngle::fromBuild(actor->int_ang()) - ang).Normalized180() < DAngle::fromBuild(actor->spr.lotag);
ang_test = deltaangle(ang, DAngle::fromBuild(actor->int_ang())) < DAngle::fromBuild(actor->spr.lotag);
FAFcansee_test =
(FAFcansee(actor->int_pos().X, actor->int_pos().Y, actor->int_pos().Z, actor->sector(), *tx, *ty, *tz, pp->cursector) ||

View file

@ -1551,7 +1551,7 @@ void DoPlayerTurnTurret(PLAYER* pp, float avel)
if (sop->limit_ang_center >= nullAngle)
{
diff = (new_ang - sop->limit_ang_center).Normalized180();
diff = deltaangle(sop->limit_ang_center, new_ang);
if (abs(diff) >= sop->limit_ang_delta)
{

View file

@ -2801,7 +2801,7 @@ void DoAutoTurretObject(SECTOR_OBJECT* sop)
if (sop->limit_ang_center >= nullAngle)
{
diff = (DAngle::fromBuild(sop->ang) - sop->limit_ang_center).Normalized180();
diff = deltaangle(sop->limit_ang_center, DAngle::fromBuild(sop->ang));
if (abs(diff) >= sop->limit_ang_delta)
{