summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp15
-rw-r--r--src/peds/PedFight.cpp8
-rw-r--r--src/peds/PedIK.h2
-rw-r--r--src/peds/PlayerPed.cpp11
4 files changed, 35 insertions, 1 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 8d0fbbe8..3ccae5d0 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -393,8 +393,20 @@ CPed::BuildPedLists(void)
if (ped != this && !ped->bInVehicle) {
float dist = (ped->GetPosition() - GetPosition()).Magnitude2D();
if (nThreatReactionRangeMultiplier * 30.0f > dist) {
+#ifdef FIX_BUGS
+ // If the gap ped list is full, sort it and truncate it
+ // before pushing more unsorted peds
+ if( gnNumTempPedList == ARRAY_SIZE(gapTempPedList) - 1 )
+ {
+ gapTempPedList[gnNumTempPedList] = nil;
+ SortPeds(gapTempPedList, 0, gnNumTempPedList - 1);
+ gnNumTempPedList = ARRAY_SIZE(m_nearPeds);
+ }
+#endif
+
gapTempPedList[gnNumTempPedList] = ped;
gnNumTempPedList++;
+ // NOTE: We cannot absolutely fill the gap list, as the list is null-terminated before being passed to SortPeds
assert(gnNumTempPedList < ARRAY_SIZE(gapTempPedList));
}
}
@@ -1348,6 +1360,9 @@ CPed::CalculateNewVelocity(void)
limitedRotDest -= 2 * PI;
}
+#ifdef FREE_CAM
+ if (!TheCamera.Cams[0].Using3rdPersonMouseCam())
+#endif
if (IsPlayer() && m_nPedState == PED_ATTACK)
headAmount /= 4.0f;
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp
index 46ac369c..13d3930c 100644
--- a/src/peds/PedFight.cpp
+++ b/src/peds/PedFight.cpp
@@ -320,6 +320,14 @@ CPed::SetAttack(CEntity *victim)
((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch();
}
}
+#ifdef FIX_BUGS
+ // fix aiming for flamethrower while using PC controls
+ else if (GetWeapon()->m_eWeaponType == WEAPONTYPE_FLAMETHROWER && TheCamera.Cams[0].Using3rdPersonMouseCam() && this == FindPlayerPed())
+ {
+ SetAimFlag(m_fRotationCur);
+ ((CPlayerPed*)this)->m_fFPSMoveHeading = TheCamera.Find3rdPersonQuickAimPitch();
+ }
+#endif
if (m_nPedState == PED_ATTACK) {
bIsAttacking = true;
return;
diff --git a/src/peds/PedIK.h b/src/peds/PedIK.h
index 9077fbea..1543fa34 100644
--- a/src/peds/PedIK.h
+++ b/src/peds/PedIK.h
@@ -29,7 +29,7 @@ class CPedIK
{
public:
enum {
- GUN_POINTED_SUCCESSFULLY = 1, // set but unused
+ GUN_POINTED_SUCCESSFULLY = 1,
LOOKAROUND_HEAD_ONLY = 2,
AIMS_WITH_ARM = 4,
};
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 6d6fc714..416fb949 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -503,6 +503,10 @@ CPlayerPed::DoWeaponSmoothSpray(void)
{
if (m_nPedState == PED_ATTACK && !m_pPointGunAt) {
eWeaponType weapon = GetWeapon()->m_eWeaponType;
+#ifdef FREE_CAM
+ if(TheCamera.Cams[0].Using3rdPersonMouseCam() && (weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI))
+ return false;
+#endif
if (weapon == WEAPONTYPE_FLAMETHROWER || weapon == WEAPONTYPE_COLT45 || weapon == WEAPONTYPE_UZI || weapon == WEAPONTYPE_SHOTGUN ||
weapon == WEAPONTYPE_AK47 || weapon == WEAPONTYPE_M16 || weapon == WEAPONTYPE_HELICANNON)
return true;
@@ -1183,6 +1187,13 @@ CPlayerPed::PlayerControlZelda(CPad *padUsed)
padMoveInGameUnit = CVector2D(leftRight, upDown).Magnitude() / PAD_MOVE_TO_GAME_WORLD_MOVE;
}
+#ifdef FREE_CAM
+ if(TheCamera.Cams[0].Using3rdPersonMouseCam() && doSmoothSpray) {
+ padMoveInGameUnit = 0.0f;
+ smoothSprayWithoutMove = false;
+ }
+#endif
+
if (padMoveInGameUnit > 0.0f || smoothSprayWithoutMove) {
float padHeading = CGeneral::GetRadianAngleBetweenPoints(0.0f, 0.0f, -leftRight, upDown);
float neededTurn = CGeneral::LimitRadianAngle(padHeading - camOrientation);