diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-04-15 22:28:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 22:28:09 +0200 |
commit | 5cb7e2e42a17104a80053f1219ebbb022ff1dea1 (patch) | |
tree | c59643f93c566c0813551f0b59596d44573c7c5b /src/peds | |
parent | Merge pull request #429 from Nick007J/master (diff) | |
parent | fixed crash (diff) | |
download | re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar.gz re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar.bz2 re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar.lz re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar.xz re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.tar.zst re3-5cb7e2e42a17104a80053f1219ebbb022ff1dea1.zip |
Diffstat (limited to 'src/peds')
-rw-r--r-- | src/peds/Ped.cpp | 2 | ||||
-rw-r--r-- | src/peds/Ped.h | 5 | ||||
-rw-r--r-- | src/peds/PlayerPed.cpp | 8 | ||||
-rw-r--r-- | src/peds/PlayerPed.h | 4 |
4 files changed, 12 insertions, 7 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index d6077ed8..4696df31 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -1228,7 +1228,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 321d5bff..9f660693 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..f96d8e6a 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; bool m_bHaveTargetSelected; // may have better name int8 field_1381; int8 field_1382; |