diff options
author | Filip Gawin <filip.gawin@zoho.com> | 2020-02-25 20:01:56 +0100 |
---|---|---|
committer | Filip Gawin <filip.gawin@zoho.com> | 2020-03-22 17:30:54 +0100 |
commit | 8f01eab5ab97c498fd308c091ad9c555b2f67b56 (patch) | |
tree | c7b9b88d8b77ab3559be411dbbfeda98e3294c7b /src/peds | |
parent | Implement ProcessGarages + small cleanup (diff) | |
download | re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.gz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.bz2 re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.lz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.xz re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.tar.zst re3-8f01eab5ab97c498fd308c091ad9c555b2f67b56.zip |
Diffstat (limited to 'src/peds')
-rw-r--r-- | src/peds/Ped.cpp | 10 | ||||
-rw-r--r-- | src/peds/Population.cpp | 2 |
2 files changed, 6 insertions, 6 deletions
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 diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index bb5ec475..9876f946 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -1170,4 +1170,4 @@ STARTPATCHES InjectHook(0x4F4690, &CPopulation::TestRoomForDummyObject, PATCH_JUMP); InjectHook(0x4F45A0, &CPopulation::ConvertToDummyObject, PATCH_JUMP); InjectHook(0x4F4410, &CPopulation::ConvertAllObjectsToDummyObjects, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file +ENDPATCHES |