summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-26 01:34:40 +0200
committerGitHub <noreply@github.com>2019-07-26 01:34:40 +0200
commit01bbb0530b3ede5d45eb730696b64f87eb1c1045 (patch)
treef86d3d0e5b4ec32026775eb9ede17e894d6ca40e /src/peds
parentMerge pull request #162 from erorcun/erorcun (diff)
parentMerge branch 'master' into master (diff)
downloadre3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar.gz
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar.bz2
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar.lz
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar.xz
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.tar.zst
re3-01bbb0530b3ede5d45eb730696b64f87eb1c1045.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp16
-rw-r--r--src/peds/Ped.h4
2 files changed, 18 insertions, 2 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index addbf782..fb9b778f 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -49,6 +49,7 @@ WRAPPER void CPed::MakeChangesForNewWeapon(int8) { EAXJMP(0x4F2560); }
WRAPPER void CPed::SetSeek(CVector, float) { EAXJMP(0x4D14B0); }
WRAPPER bool CPed::Seek(void) { EAXJMP(0x4D1640); }
WRAPPER void CPed::SetFollowPath(CVector) { EAXJMP(0x4D2EA0); }
+WRAPPER void CPed::RemoveInCarAnims(void) { EAXJMP(0x4E4E20); }
WRAPPER void CPed::SetWaitState(eWaitState, void*) { EAXJMP(0x4D58D0); }
WRAPPER void CPed::StartFightDefend(uint8, uint8, uint8) { EAXJMP(0x4E7780); }
WRAPPER void CPed::PlayHitSound(CPed*) { EAXJMP(0x4E8E20); }
@@ -402,7 +403,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
bIsPedDieAnimPlaying = false;
m_ped_flagD20 = false;
m_ped_flagD40 = false;
- m_bScriptObjectiveCompleted = false;
+ bScriptObjectiveCompleted = false;
bKindaStayInSamePlace = false;
m_ped_flagE2 = false;
@@ -4046,6 +4047,18 @@ CPed::SetAmmo(eWeaponType weaponType, uint32 ammo)
}
void
+CPed::GrantAmmo(eWeaponType weaponType, uint32 ammo)
+{
+ if (HasWeapon(weaponType)) {
+ GetWeapon(weaponType).m_nAmmoTotal += ammo;
+ }
+ else {
+ GetWeapon(weaponType).Initialise(weaponType, ammo);
+ m_maxWeaponTypeAllowed++;
+ }
+}
+
+void
CPed::SetEvasiveStep(CEntity *reason, uint8 animType)
{
AnimationId stepAnim;
@@ -4865,6 +4878,7 @@ STARTPATCHES
InjectHook(0x4D6540, &CPed::RestoreHeadingRate, PATCH_JUMP);
InjectHook(0x4C69E0, (void (CPed::*)(CEntity*)) &CPed::SetAimFlag, PATCH_JUMP);
InjectHook(0x4C6960, (void (CPed::*)(float)) &CPed::SetAimFlag, PATCH_JUMP);
+ InjectHook(0x4CFAD0, &CPed::GrantAmmo, PATCH_JUMP);
InjectHook(0x4CFB20, &CPed::SetAmmo, PATCH_JUMP);
InjectHook(0x4D33A0, &CPed::SetEvasiveDive, PATCH_JUMP);
InjectHook(0x4D09B0, &CPed::SetFall, PATCH_JUMP);
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 79ef1705..2ef0ebd1 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -262,7 +262,7 @@ public:
uint8 bIsPedDieAnimPlaying : 1;
uint8 m_ped_flagD20 : 1;
uint8 m_ped_flagD40 : 1; // reset when objective changes
- uint8 m_bScriptObjectiveCompleted : 1;
+ uint8 bScriptObjectiveCompleted : 1;
uint8 bKindaStayInSamePlace : 1;
uint8 m_ped_flagE2 : 1;
@@ -545,6 +545,7 @@ public:
void SetAimFlag(float angle);
void SetAmmo(eWeaponType weaponType, uint32 ammo);
void SetEvasiveStep(CEntity*, uint8);
+ void GrantAmmo(eWeaponType, uint32);
void SetEvasiveDive(CPhysical*, uint8);
void SetAttack(CEntity*);
void StartFightAttack(uint8);
@@ -611,6 +612,7 @@ public:
void SetLeader(CEntity* leader);
void SetPedStats(ePedStats);
bool IsGangMember(void);
+ void RemoveInCarAnims(void);
bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }