rename clamp macro to Clamp to fix compilation with g++11 (and clamp2 for consistency sake)
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user