summaryrefslogtreecommitdiffstats
path: root/src/peds/PlayerPed.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-12-14 08:47:07 +0100
committerSergeanur <s.anureev@yandex.ua>2020-12-14 08:47:07 +0100
commitf42a01f653c860b5df3cfdbe34cc37f25dc3c36a (patch)
treebc6a09f0a1ca0fafbf1e53b4c8e60b581281c0c4 /src/peds/PlayerPed.cpp
parentMerge branch 'master' of https://github.com/GTAmodding/re3 (diff)
downloadre3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.gz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.bz2
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.lz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.xz
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.tar.zst
re3-f42a01f653c860b5df3cfdbe34cc37f25dc3c36a.zip
Diffstat (limited to '')
-rw-r--r--src/peds/PlayerPed.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index f23aa378..ef9cf201 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -47,8 +47,8 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
m_nSelectedWepSlot = WEAPONTYPE_UNARMED;
m_nSpeedTimer = 0;
m_bSpeedTimerFlag = false;
- m_pPointGunAt = nil;
- m_nPedState = PED_IDLE;
+ SetWeaponLockOnTarget(nil);
+ SetPedState(PED_IDLE);
#ifndef FIX_BUGS
m_fCurrentStamina = m_fMaxStamina = 150.0f;
#endif
@@ -73,7 +73,7 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
void CPlayerPed::ClearWeaponTarget()
{
if (m_nPedType == PEDTYPE_PLAYER1) {
- m_pPointGunAt = nil;
+ SetWeaponLockOnTarget(nil);
TheCamera.ClearPlayerWeaponMode();
CWeaponEffects::ClearCrossHair();
}
@@ -875,9 +875,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
if (!nextTarget)
return false;
- m_pPointGunAt = nextTarget;
- if (nextTarget)
- nextTarget->RegisterReference((CEntity**)&m_pPointGunAt);
+ SetWeaponLockOnTarget(nextTarget);
SetPointGunAt(nextTarget);
return true;
}
@@ -891,7 +889,7 @@ CPlayerPed::FindWeaponLockOnTarget(void)
if (m_pPointGunAt) {
CVector distVec = m_pPointGunAt->GetPosition() - GetPosition();
if (distVec.Magnitude2D() > weaponRange) {
- m_pPointGunAt = nil;
+ SetWeaponLockOnTarget(nil);
return false;
} else {
return true;
@@ -922,9 +920,7 @@ CPlayerPed::FindWeaponLockOnTarget(void)
if (!nextTarget)
return false;
- m_pPointGunAt = nextTarget;
- if (nextTarget)
- nextTarget->RegisterReference((CEntity**)&m_pPointGunAt);
+ SetWeaponLockOnTarget(nextTarget);
SetPointGunAt(nextTarget);
return true;
}