summaryrefslogtreecommitdiffstats
path: root/src/peds/CivilianPed.cpp
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-04-11 23:57:46 +0200
committerGitHub <noreply@github.com>2020-04-11 23:57:46 +0200
commit207aebc46c261df1e0b22df6d4e592ff348458ce (patch)
treeda8c68bafb71b162406337baac07666f7a6cf90f /src/peds/CivilianPed.cpp
parentMerge pull request #404 from Sergeanur/rwlink (diff)
parentCMenuManager done and CHud fixes (diff)
downloadre3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar.gz
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar.bz2
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar.lz
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar.xz
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.tar.zst
re3-207aebc46c261df1e0b22df6d4e592ff348458ce.zip
Diffstat (limited to '')
-rw-r--r--src/peds/CivilianPed.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/peds/CivilianPed.cpp b/src/peds/CivilianPed.cpp
index 533d7c98..a9e0580e 100644
--- a/src/peds/CivilianPed.cpp
+++ b/src/peds/CivilianPed.cpp
@@ -28,10 +28,8 @@ CCivilianPed::CivilianAI(void)
return;
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
- if (m_pedInObjective) {
- if (m_pedInObjective->IsPlayer())
- return;
- }
+ if (m_pedInObjective && m_pedInObjective->IsPlayer())
+ return;
}
if (CTimer::GetTimeInMilliseconds() <= m_lookTimer)
return;
@@ -75,7 +73,7 @@ CCivilianPed::CivilianAI(void)
} else {
SetMoveState(PEDMOVE_WALK);
}
- } else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops) {
+ } else if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
SetFindPathAndFlee(m_threatEntity, 5000);
if (threatDistSqr < sq(10.0f)) {
SetMoveState(PEDMOVE_RUN);
@@ -170,8 +168,8 @@ CCivilianPed::CivilianAI(void)
if (m_threatEntity && m_threatEntity->IsPed()) {
CPed *threatPed = (CPed*)m_threatEntity;
if (m_pedStats->m_fear <= 100 - threatPed->m_pedStats->m_temper && threatPed->m_nPedType != PEDTYPE_COP) {
- if (threatPed->GetWeapon()->IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
- if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops) {
+ if (threatPed->GetWeapon(m_currentWeapon).IsTypeMelee() || !GetWeapon()->IsTypeMelee()) {
+ if (threatPed->IsPlayer() && FindPlayerPed()->m_pWanted->m_CurrentCops != 0) {
if (m_objective == OBJECTIVE_KILL_CHAR_ON_FOOT || m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS) {
SetFindPathAndFlee(m_threatEntity, 10000);
}