summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorerorcun <erorcunerorcun@hotmail.com.tr>2021-06-30 02:31:10 +0200
committererorcun <erorcunerorcun@hotmail.com.tr>2021-06-30 02:31:10 +0200
commit9f0daee186dc815cbf4e8a68871d375bd4752737 (patch)
treecc2ec2e0ade1a44232d97b113bbeda96aa4c8a6f /src/peds
parentfix no VALIDATE_SAVE_SIZE build (diff)
downloadre3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar.gz
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar.bz2
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar.lz
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar.xz
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.tar.zst
re3-9f0daee186dc815cbf4e8a68871d375bd4752737.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/CopPed.cpp3
-rw-r--r--src/peds/PedFight.cpp2
-rw-r--r--src/peds/PlayerPed.cpp8
3 files changed, 8 insertions, 5 deletions
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 1efd7733..fbfa7249 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -644,6 +644,9 @@ CCopPed::ProcessControl(void)
int numCopsNear = 0;
for (int i = 0; i < player->m_numNearPeds; ++i) {
CPed *nearPed = player->m_nearPeds[i];
+#ifdef FIX_BUGS
+ if (nearPed)
+#endif
if (nearPed->m_nPedType == PEDTYPE_COP && nearPed->m_nPedState != PED_DEAD)
++numCopsNear;
}
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 7bcf6b6c..8e377c81 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -1304,7 +1304,7 @@ CPed::StartFightDefend(uint8 direction, uint8 hitLevel, uint8 unk)
if (IsPlayer())
moveAssoc->speed = 1.2f;
- m_takeAStepAfterAttack = 0;
+ m_takeAStepAfterAttack = false;
m_fightButtonPressure = 0;
} else if (IsPlayer() && GetWeapon()->m_eWeaponType != WEAPONTYPE_UNARMED && GetWeapon()->m_eWeaponType != WEAPONTYPE_BRASSKNUCKLE &&
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index b4e7f647..d54dedd9 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -837,8 +837,8 @@ CPlayerPed::PlayerControlFighter(CPad *padUsed)
if (padMove > 0.0f) {
m_fRotationDest = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown) - TheCamera.Orientation;
- m_takeAStepAfterAttack = padMove > 2 * PAD_MOVE_TO_GAME_WORLD_MOVE;
- if (padUsed->GetSprint() && padMove > 1 * PAD_MOVE_TO_GAME_WORLD_MOVE)
+ m_takeAStepAfterAttack = padMove > (2 * PAD_MOVE_TO_GAME_WORLD_MOVE);
+ if (padUsed->GetSprint() && padMove > (1 * PAD_MOVE_TO_GAME_WORLD_MOVE))
bIsAttacking = false;
}
@@ -2081,8 +2081,8 @@ void
CPlayerPed::RemovePedFromMeleeList(CPed *ped)
{
int i = 0;
- for (; m_pMeleeList[i] != ped; i++) {
- if (i >= ARRAY_SIZE(m_pMeleeList))
+ while (m_pMeleeList[i] != ped) {
+ if (++i >= ARRAY_SIZE(m_pMeleeList))
return;
}
m_pMeleeList[i] = nil;