diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-12 11:08:30 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-12 11:08:30 +0200 |
commit | cbb298c8dd0ff23007ba403157a47da1ddf134d5 (patch) | |
tree | 6f069af03c21d9af52cdcebd6fef7117454394d1 /src/peds/CivilianPed.cpp | |
parent | Merge branch 'master' into garages_dev (diff) | |
parent | Merge pull request #402 from Nick007J/master (diff) | |
download | re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.gz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.bz2 re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.lz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.xz re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.tar.zst re3-cbb298c8dd0ff23007ba403157a47da1ddf134d5.zip |
Diffstat (limited to 'src/peds/CivilianPed.cpp')
-rw-r--r-- | src/peds/CivilianPed.cpp | 12 |
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); } |