From 8f01eab5ab97c498fd308c091ad9c555b2f67b56 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Tue, 25 Feb 2020 20:01:56 +0100 Subject: Fixes for Serge's review --- src/peds/Ped.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/peds/Ped.cpp') diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index b7dbab82..45590b07 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -7642,21 +7642,21 @@ CPed::Flee(void) else if (PI + angleToFleeEntity < angleToFleeDamagingThing) angleToFleeDamagingThing -= TWOPI; - if (damagingThingPriorityMult <= 1.0) { + if (damagingThingPriorityMult <= 1.0f) { // Range [0.0, 1.0] - double angleToFleeBoth = (angleToFleeDamagingThing + angleToFleeEntity) * 0.5; + float angleToFleeBoth = (angleToFleeDamagingThing + angleToFleeEntity) * 0.5f; if (m_fRotationDest - PI > angleToFleeBoth) angleToFleeBoth += TWOPI; else if (PI + m_fRotationDest < angleToFleeBoth) angleToFleeBoth -= TWOPI; - m_fRotationDest = (1.0 - damagingThingPriorityMult) * m_fRotationDest + damagingThingPriorityMult * angleToFleeBoth; + m_fRotationDest = (1.0f - damagingThingPriorityMult) * m_fRotationDest + damagingThingPriorityMult * angleToFleeBoth; } else { // Range (1.0, 1.5] - double adjustedMult = (damagingThingPriorityMult - 1.0) * 2.0; + double adjustedMult = (damagingThingPriorityMult - 1.0f) * 2.0f; m_fRotationDest = angleToFleeEntity * (1.0 - adjustedMult) + adjustedMult * angleToFleeDamagingThing; } } else { @@ -17676,4 +17676,4 @@ STARTPATCHES InjectHook(0x4E52A0, &CPed::WarpPedToNearLeaderOffScreen, PATCH_JUMP); InjectHook(0x4E0220, &CPed::SetCarJack, PATCH_JUMP); InjectHook(0x4D6780, &CPed::Solicit, PATCH_JUMP); -ENDPATCHES \ No newline at end of file +ENDPATCHES -- cgit v1.2.3