summaryrefslogtreecommitdiffstats
path: root/src/peds/CopPed.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-16 18:31:18 +0200
committerGitHub <noreply@github.com>2019-07-16 18:31:18 +0200
commit9477aca836efd0bcf5017ff6a6c81f2326fd97c1 (patch)
treeb80e8bc8569fbdda5929123a8f47d0c62aea0ab0 /src/peds/CopPed.cpp
parentPhone, World, Ped (diff)
parentMerge pull request #136 from Nick007J/master (diff)
downloadre3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar.gz
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar.bz2
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar.lz
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar.xz
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.tar.zst
re3-9477aca836efd0bcf5017ff6a6c81f2326fd97c1.zip
Diffstat (limited to '')
-rw-r--r--src/peds/CopPed.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/peds/CopPed.cpp b/src/peds/CopPed.cpp
index 0ac0473f..5bc67e15 100644
--- a/src/peds/CopPed.cpp
+++ b/src/peds/CopPed.cpp
@@ -1,6 +1,64 @@
#include "common.h"
#include "patcher.h"
#include "CopPed.h"
+#include "ModelIndices.h"
+
+WRAPPER void CCopPed::ProcessControl() { EAXJMP(0x4C1400); }
+
+CCopPed::CCopPed(eCopType copType) : CPed(PEDTYPE_COP)
+{
+ m_nCopType = copType;
+ switch (copType) {
+ case COP_STREET:
+ SetModelIndex(MI_COP);
+ GiveWeapon(WEAPONTYPE_COLT45, 1000);
+ m_currentWeapon = WEAPONTYPE_UNARMED;
+ m_fArmour = 0.0f;
+ m_wepSkills = 208; /* TODO: what is this? seems unused */
+ m_wepAccuracy = 60;
+ break;
+ case COP_FBI:
+ SetModelIndex(MI_FBI);
+ GiveWeapon(WEAPONTYPE_COLT45, 1000);
+ GiveWeapon(WEAPONTYPE_AK47, 1000);
+ SetCurrentWeapon(WEAPONTYPE_AK47);
+ m_fArmour = 100.0f;
+ m_wepSkills = 176; /* TODO: what is this? seems unused */
+ m_wepAccuracy = 76;
+ break;
+ case COP_SWAT:
+ SetModelIndex(MI_SWAT);
+ GiveWeapon(WEAPONTYPE_COLT45, 1000);
+ GiveWeapon(WEAPONTYPE_UZI, 1000);
+ SetCurrentWeapon(WEAPONTYPE_UZI);
+ m_fArmour = 50.0f;
+ m_wepSkills = 32; /* TODO: what is this? seems unused */
+ m_wepAccuracy = 64;
+ break;
+ case COP_ARMY:
+ SetModelIndex(MI_ARMY);
+ GiveWeapon(WEAPONTYPE_COLT45, 1000);
+ GiveWeapon(WEAPONTYPE_M16, 1000);
+ GiveWeapon(WEAPONTYPE_GRENADE, 10);
+ SetCurrentWeapon(WEAPONTYPE_M16);
+ m_fArmour = 100.0f;
+ m_wepSkills = 32; /* TODO: what is this? seems unused */
+ m_wepAccuracy = 84;
+ break;
+ default:
+ break;
+ }
+ m_bIsInPursuit = false;
+ field_1350 = 1;
+ m_bIsDisabledCop = false;
+ field_1356 = 0;
+ m_attackTimer = 0;
+ field_1351 = 0;
+ m_bZoneDisabledButClose = false;
+ m_bZoneDisabled = false;
+ field_1364 = -1;
+ m_pPointGunAt = nil;
+}
CCopPed::~CCopPed()
{
@@ -12,9 +70,11 @@ WRAPPER void CCopPed::ClearPursuit(void) { EAXJMP(0x4C28C0); }
class CCopPed_ : public CCopPed
{
public:
+ CCopPed *ctor(eCopType type) { return ::new (this) CCopPed(type); };
void dtor(void) { CCopPed::~CCopPed(); }
};
STARTPATCHES
+ InjectHook(0x4C11B0, &CCopPed_::ctor, PATCH_JUMP);
InjectHook(0x4C13E0, &CCopPed_::dtor, PATCH_JUMP);
ENDPATCHES