summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp2
-rw-r--r--src/peds/Ped.h5
-rw-r--r--src/peds/PlayerPed.cpp8
-rw-r--r--src/peds/PlayerPed.h4
4 files changed, 12 insertions, 7 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 2cd942f9..4ee31a30 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -1231,7 +1231,7 @@ CPed::Attack(void)
weaponAnimAssoc->SetCurrentTime(0.0f);
if (IsPlayer()) {
- ((CPlayerPed*)this)->field_1376 = 0.0f;
+ ((CPlayerPed*)this)->m_fAttackButtonCounter = 0.0f;
((CPlayerPed*)this)->m_bHaveTargetSelected = false;
}
}
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 2edd5d68..ea8c4080 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -796,7 +796,12 @@ public:
PedState GetPedState(void) { return m_nPedState; }
void SetPedState(PedState state) { m_nPedState = state; }
+ bool Dead(void) { return m_nPedState == PED_DEAD; }
+ bool Dying(void) { return m_nPedState == PED_DIE; }
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
+ bool OnGround(void) { return m_nPedState == PED_FALL || m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }
+
+ bool Driving(void) { return m_nPedState == PED_DRIVING; }
bool InVehicle(void) { return bInVehicle && m_pMyVehicle; } // True when ped is sitting/standing in vehicle, not in enter/exit state.
bool EnteringCar(void) { return m_nPedState == PED_ENTER_CAR || m_nPedState == PED_CARJACK; }
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index ccc0a43a..dcd9486f 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -43,8 +43,8 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
m_fStaminaProgress = 0.0f;
m_nEvadeAmount = 0;
field_1367 = 0;
- m_nShotDelay = 0;
- field_1376 = 0.0f;
+ m_nHitAnimDelayTimer = 0;
+ m_fAttackButtonCounter = 0.0f;
m_bHaveTargetSelected = false;
m_bHasLockOnTarget = false;
m_bCanBeDamaged = true;
@@ -1024,10 +1024,10 @@ CPlayerPed::ProcessPlayerWeapon(CPad *padUsed)
if (padUsed->WeaponJustDown()) {
m_bHaveTargetSelected = true;
} else if (!m_bHaveTargetSelected) {
- field_1376 += CTimer::GetTimeStepNonClipped();
+ m_fAttackButtonCounter += CTimer::GetTimeStepNonClipped();
}
} else {
- field_1376 = 0.0f;
+ m_fAttackButtonCounter = 0.0f;
m_bHaveTargetSelected = false;
}
SetAttack(nil);
diff --git a/src/peds/PlayerPed.h b/src/peds/PlayerPed.h
index c139bbbc..c6823c2d 100644
--- a/src/peds/PlayerPed.h
+++ b/src/peds/PlayerPed.h
@@ -20,8 +20,8 @@ public:
uint8 m_nEvadeAmount;
int8 field_1367;
uint32 m_nSpeedTimer;
- int32 m_nShotDelay;
- float field_1376; // m_fAttackButtonCounter?
+ uint32 m_nHitAnimDelayTimer;
+ float m_fAttackButtonCounter; // m_fAttackButtonCounter?
bool m_bHaveTargetSelected; // may have better name
int8 field_1381;
int8 field_1382;