summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-02-10 13:26:42 +0100
committererorcun <erorcunerorcun@hotmail.com.tr>2021-02-10 13:26:42 +0100
commit775db94a965ecf11c0f12b79d74b57dbe7f60c04 (patch)
treee0bd6c92d6c57ea95c98936f3c1286c8e24dda5a /src/peds
parentMerge branch 'miami' of https://github.com/GTAmodding/re3 into miami (diff)
downloadre3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar.gz
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar.bz2
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar.lz
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar.xz
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.tar.zst
re3-775db94a965ecf11c0f12b79d74b57dbe7f60c04.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 12437dcd..ba09e8a4 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -2336,12 +2336,17 @@ CPed::ProcessControl(void)
}
uint8 flyDir = 0;
float feetZ = GetPosition().z - FEET_OFFSET;
- if ((obstacleForFlyingZ <= feetZ || obstacleForFlyingOtherDirZ >= 500.0f) && (obstacleForFlyingZ <= feetZ || obstacleForFlyingOtherDirZ <= feetZ)) {
- if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 499.0f)
- flyDir = 2;
- } else {
+#ifdef FIX_BUGS
+ if (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 501.0f)
flyDir = 1;
- }
+ else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 500.0f)
+ flyDir = 2;
+#else
+ if ((obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ < 500.0f) || (obstacleForFlyingZ > feetZ && obstacleForFlyingOtherDirZ > feetZ))
+ flyDir = 1;
+ else if (obstacleForFlyingOtherDirZ > feetZ && obstacleForFlyingZ < 499.0f)
+ flyDir = 2;
+#endif
if (flyDir != 0 && !bHeadStuckInCollision) {
SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point));
@@ -2358,6 +2363,10 @@ CPed::ProcessControl(void)
forceDir.z = 4.0f;
ApplyMoveForce(forceDir);
+ // What was that for?? It pushes player inside of collision sometimes and kills him.
+#ifdef FIX_BUGS
+ if (!IsPlayer())
+#endif
GetMatrix().GetPosition() += 0.25f * offsetToCheck;
m_fRotationCur = CGeneral::GetRadianAngleBetweenPoints(offsetToCheck.x, offsetToCheck.y, 0.0f, 0.0f);