summaryrefslogtreecommitdiffstats
path: root/src/peds/PlayerPed.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-08-21 12:25:42 +0200
committerSergeanur <s.anureev@yandex.ua>2021-08-21 12:25:42 +0200
commite0be6beb18e55338cda7a613bb9b8df798c81b17 (patch)
tree22514458646c67c2981ea368b00d474a50b4de86 /src/peds/PlayerPed.cpp
parentcar ctrl fixes (diff)
parentRemove cMissionAudio, move cAMCrime array outside of cPoliceRadioQueue (R* vision) (diff)
downloadre3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar.gz
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar.bz2
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar.lz
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar.xz
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.tar.zst
re3-e0be6beb18e55338cda7a613bb9b8df798c81b17.zip
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r--src/peds/PlayerPed.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 3da6c500..3e6509f5 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -777,7 +777,8 @@ spentAmmoCheck:
// BUG: m_nSelectedWepSlot and GetWeapon(..) takes slot in VC but they compared them against weapon types in whole condition! jeez
#ifdef FIX_BUGS
- if (m_nSelectedWepSlot == WEAPONSLOT_MELEE || GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && m_nSelectedWepSlot != WEAPONSLOT_PROJECTILE) {
+ if (m_nSelectedWepSlot == WEAPONSLOT_MELEE ||
+ GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && (m_nSelectedWepSlot != WEAPONSLOT_PROJECTILE || GetWeapon(WEAPONSLOT_PROJECTILE).m_eWeaponType == WEAPONTYPE_DETONATOR_GRENADE)) {
#else
if (m_nSelectedWepSlot == WEAPONTYPE_BASEBALLBAT && GetWeapon(WEAPONTYPE_BASEBALLBAT).m_eWeaponType == WEAPONTYPE_BASEBALLBAT
|| GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0
@@ -1057,7 +1058,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
// nextTarget = nil; // duplicate
float lastCloseness = -10000.0f;
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
- CVector distVec = previousTarget->GetPosition() - GetPosition();
+ CVector distVec = previousTarget->GetPosition() - TheCamera.GetPosition();
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
@@ -1069,7 +1070,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
&& (!pedToCheck->bInVehicle || (pedToCheck->m_pMyVehicle && pedToCheck->m_pMyVehicle->IsBike()))
#endif
&& pedToCheck->m_leader != this && !pedToCheck->bNeverEverTargetThisPed
- && OurPedCanSeeThisOne(pedToCheck) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
+ && OurPedCanSeeThisOne(pedToCheck, true) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
EvaluateNeighbouringTarget(pedToCheck, &nextTarget, &lastCloseness,
weaponRange, referenceBeta, lookToLeft, IsThisPedAnAimingPriority(pedToCheck));
@@ -1196,7 +1197,7 @@ CPlayerPed::ProcessAnimGroups(void)
GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
groupToSet = ASSOCGRP_PLAYERCHAINSAW;
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
- // I hope this is a inlined function...
+ // I hope this is an inlined function...
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA