From d17d437de319ca4c388dc724cffea91702d3a699 Mon Sep 17 00:00:00 2001 From: withmorten Date: Mon, 28 Jun 2021 13:57:05 +0200 Subject: rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake) --- src/control/CarCtrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/control/CarCtrl.cpp') diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 21526d5e..5e4e62ee 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -2575,7 +2575,7 @@ void CCarCtrl::SteerAIBoatWithPhysicsHeadingForTarget(CVehicle* pVehicle, float float angleToTarget = CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y); float angleForward = CGeneral::GetATanOfXY(forward.x, forward.y); float steerAngle = LimitRadianAngle(angleToTarget - angleForward); - steerAngle = clamp(steerAngle, -DEFAULT_MAX_STEER_ANGLE, DEFAULT_MAX_STEER_ANGLE); + steerAngle = Clamp(steerAngle, -DEFAULT_MAX_STEER_ANGLE, DEFAULT_MAX_STEER_ANGLE); #ifdef FIX_BUGS float speedTarget = pVehicle->AutoPilot.GetCruiseSpeed(); #else @@ -2735,7 +2735,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane) { CVector2D vecToTarget = pPlane->AutoPilot.m_vecDestinationCoors - pPlane->GetPosition(); float fForwardZ = (pPlane->AutoPilot.m_vecDestinationCoors.z - pPlane->GetPosition().z) / vecToTarget.Magnitude(); - fForwardZ = clamp(fForwardZ, -0.3f, 0.3f); + fForwardZ = Clamp(fForwardZ, -0.3f, 0.3f); float angle = CGeneral::GetATanOfXY(vecToTarget.x, vecToTarget.y); while (angle > TWOPI) angle -= TWOPI; -- cgit v1.2.3