summaryrefslogtreecommitdiffstats
path: root/src/peds/PlayerPed.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-05-23 17:04:33 +0200
committereray orçunus <erayorcunus@gmail.com>2020-05-23 17:04:33 +0200
commitc3b41d79a2d7490f3745bfc63484433ef88a34f9 (patch)
treed24449f81dc9cb60e20e30ded3ad2cd4f7fa134d /src/peds/PlayerPed.cpp
parentCompatibility with VC weapon.dat + new shotguns (diff)
downloadre3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar.gz
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar.bz2
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar.lz
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar.xz
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.tar.zst
re3-c3b41d79a2d7490f3745bfc63484433ef88a34f9.zip
Diffstat (limited to 'src/peds/PlayerPed.cpp')
-rw-r--r--src/peds/PlayerPed.cpp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp
index 69369ea4..bbdf57ed 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -47,19 +47,12 @@ CPlayerPed::CPlayerPed(void) : CPed(PEDTYPE_PLAYER1)
m_nSpeedTimer = 0;
m_bSpeedTimerFlag = false;
- // This should be something inlined
// TODO(Miami)
-
// if (pPointGunAt)
// m_pPointGunAt->CleanUpOldReference(&m_pPointGunAt);
- m_pPointGunAt = nil;
- if (m_nPedState == PED_FOLLOW_PATH)
- ClearFollowPath();
-
- // TODO(Miami)
- // This should be something inlined
- m_nPedState = PED_IDLE;
+ m_pPointGunAt = nil;
+ SetPedState(PED_IDLE);
m_fMaxStamina = 150.0f;
m_fCurrentStamina = m_fMaxStamina;
m_fStaminaProgress = 0.0f;
@@ -290,10 +283,7 @@ CPlayerPed::SetInitialState(void)
m_pFire->Extinguish();
RpAnimBlendClumpRemoveAllAssociations(GetClump());
- if (m_nPedState == PED_FOLLOW_PATH)
- ClearFollowPath();
-
- m_nPedState = PED_IDLE;
+ SetPedState(PED_IDLE);
SetMoveState(PEDMOVE_STILL);
m_nLastPedState = PED_NONE;
m_animGroup = ASSOCGRP_PLAYER;
@@ -1626,6 +1616,21 @@ CPlayerPed::ProcessControl(void)
#endif
}
+bool
+CPlayerPed::DoesPlayerWantNewWeapon(eWeaponType weapon, bool onlyIfSlotIsEmpty)
+{
+ uint32 slot = CWeaponInfo::GetWeaponInfo(weapon)->m_nWeaponSlot;
+
+ if (!HasWeaponSlot(slot) || GetWeapon(slot).m_eWeaponType == weapon)
+ return true;
+
+ if (onlyIfSlotIsEmpty)
+ return false;
+
+ // Check if he's using that slot right now.
+ return m_nPedState != PED_ATTACK && m_nPedState != PED_AIM_GUN || slot != m_currentWeapon;
+}
+
#ifdef COMPATIBLE_SAVES
#define CopyFromBuf(buf, data) memcpy(&data, buf, sizeof(data)); SkipSaveBuf(buf, sizeof(data));
#define CopyToBuf(buf, data) memcpy(buf, &data, sizeof(data)); SkipSaveBuf(buf, sizeof(data));