summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/entities')
-rw-r--r--src/entities/CopPed.h63
-rw-r--r--src/entities/CutsceneObject.cpp2
-rw-r--r--src/entities/Entity.cpp18
-rw-r--r--src/entities/Entity.h16
-rw-r--r--src/entities/Ped.cpp22
-rw-r--r--src/entities/Ped.h4
6 files changed, 90 insertions, 35 deletions
diff --git a/src/entities/CopPed.h b/src/entities/CopPed.h
index 2658a386..d41c2e9e 100644
--- a/src/entities/CopPed.h
+++ b/src/entities/CopPed.h
@@ -1,11 +1,68 @@
#pragma once
-
#include "Ped.h"
+enum eCrimeType
+{
+ CRIME_NONE,
+ CRIME_SHOT_FIRED,
+ CRIME_PED_FIGHT,
+ CRIME_COP_FIGHT,
+ CRIME_DAMAGED_PED,
+ CRIME_DAMAGED_COP,
+ CRIME_CAR_THEFT,
+ CRIME_CRIME7,
+ CRIME_COP_EVASIVE_DIVE,
+ CRIME_COP_EVASIVE_DIVE2,
+ CRIME_PED_RUN_OVER,
+ CRIME_COP_RUN_OVER,
+ CRIME_DESTROYED_HELI,
+ CRIME_PED_BURNED,
+ CRIME_COP_BURNED,
+ CRIME_VEHICLE_BURNED,
+ CRIME_DESTROYED_CESSNA,
+};
+
+enum eCopType
+{
+ COP_STREET = 0,
+ COP_FBI = 1,
+ COP_SWAT = 2,
+ COP_ARMY = 3,
+};
+
+class CCrime
+{
+public:
+ eCrimeType m_eCrimeType;
+ CEntity *m_pVictim;
+ int32 m_nCrimeTime;
+ CVector m_vecCrimePos;
+ int8 m_bReported;
+ int8 m_bMultiplier;
+ int8 pad_20[2];
+};
+
class CCopPed : public CPed
{
public:
- // 0x53C
- uint8 stuff[28];
+ int16 m_wRoadblockNode;
+ int8 field_1342;
+ int8 field_1343;
+ float m_fDistanceToTarget;
+ int8 m_bIsInPursuit;
+ int8 m_bIsDisabledCop;
+ int8 field_1350;
+ int8 field_1351;
+ int8 m_bZoneDisabledButClose;
+ int8 m_bZoneDisabled;
+ int8 field_1354;
+ int8 field_1355;
+ int32 field_1356;
+ eCopType m_nCopType;
+ int8 field_1364;
+ int8 field_1365;
+ int8 field_1366;
+ int8 field_1367;
};
+
static_assert(sizeof(CCopPed) == 0x558, "CCopPed: error");
diff --git a/src/entities/CutsceneObject.cpp b/src/entities/CutsceneObject.cpp
index 163d0513..a7bca122 100644
--- a/src/entities/CutsceneObject.cpp
+++ b/src/entities/CutsceneObject.cpp
@@ -15,7 +15,7 @@ CCutsceneObject::CCutsceneObject(void)
{
m_status = STATUS_SIMPLE;
bUsesCollision = false;
- m_flagC20 = true;
+ bStreamingDontDelete = true;
ObjectCreatedBy = CUTSCENE_OBJECT;
m_fMass = 1.0f;
m_fTurnMass = 1.0f;
diff --git a/src/entities/Entity.cpp b/src/entities/Entity.cpp
index 294518c8..e9b35cd5 100644
--- a/src/entities/Entity.cpp
+++ b/src/entities/Entity.cpp
@@ -35,14 +35,14 @@ CEntity::CEntity(void)
bIsBIGBuilding = false;
bRenderDamaged = false;
- m_flagC1 = false;
- m_flagC2 = false;
- m_flagC4 = false;
- m_flagC8 = false;
- m_flagC10 = false;
- m_flagC20 = false;
- m_bZoneCulled = false;
- m_bZoneCulled2 = false;
+ bBulletProof = false;
+ bFireProof = false;
+ bCollisionProof = false;
+ bMeleeProof = false;
+ bOnlyDamagedByPlayer = false;
+ bStreamingDontDelete = false;
+ bZoneCulled = false;
+ bZoneCulled2 = false;
bRemoveFromWorld = false;
bHasHitWall = false;
@@ -305,7 +305,7 @@ CEntity::SetupBigBuilding(void)
mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(m_modelIndex);
bIsBIGBuilding = true;
- m_flagC20 = true;
+ bStreamingDontDelete = true;
bUsesCollision = false;
m_level = CTheZones::GetLevelFromPosition(GetPosition());
if(m_level == LEVEL_NONE){
diff --git a/src/entities/Entity.h b/src/entities/Entity.h
index 8816e206..27dd8c14 100644
--- a/src/entities/Entity.h
+++ b/src/entities/Entity.h
@@ -78,14 +78,14 @@ public:
uint32 bRenderDamaged : 1;
// flagsC
- uint32 m_flagC1 : 1; // bullet proof?
- uint32 m_flagC2 : 1; // fire proof?
- uint32 m_flagC4 : 1; // collision proof?
- uint32 m_flagC8 : 1; // melee proof?
- uint32 m_flagC10 : 1; // bOnlyDamagedByPlayer?
- uint32 m_flagC20 : 1;
- uint32 m_bZoneCulled : 1;
- uint32 m_bZoneCulled2 : 1; // only treadables+10m
+ uint32 bBulletProof : 1;
+ uint32 bFireProof : 1;
+ uint32 bCollisionProof : 1;
+ uint32 bMeleeProof : 1;
+ uint32 bOnlyDamagedByPlayer : 1;
+ uint32 bStreamingDontDelete : 1;
+ uint32 bZoneCulled : 1;
+ uint32 bZoneCulled2 : 1; // only treadables+10m
// flagsD
uint32 bRemoveFromWorld : 1;
diff --git a/src/entities/Ped.cpp b/src/entities/Ped.cpp
index c4109312..0dedacad 100644
--- a/src/entities/Ped.cpp
+++ b/src/entities/Ped.cpp
@@ -249,7 +249,7 @@ CheckForPedsOnGroundToAttack(CPlayerPed *player, CPed **pedOnGround)
foundDead = 1;
if (!deadPed)
deadPed = (CPed*)currentPed;
- } else if (currentPed->IsPedHeadAbovePos(-0.6f)) {
+ } else if (!currentPed->IsPedHeadAbovePos(-0.6f)) {
foundOnTheFloor = 1;
if (!pedOnTheFloor)
pedOnTheFloor = (CPed*)currentPed;
@@ -313,10 +313,9 @@ bool
CPed::CanSetPedState(void)
{
return m_nPedState != PED_DIE && m_nPedState != PED_ARRESTED &&
- m_nPedState != PED_ENTER_CAR && m_nPedState != PED_CARJACK && m_nPedState != PED_DRAG_FROM_CAR && m_nPedState != PED_STEAL_CAR;
+ m_nPedState != PED_ENTER_CAR && m_nPedState != PED_DEAD && m_nPedState != PED_CARJACK && m_nPedState != PED_STEAL_CAR;
}
-
void
CPed::AddWeaponModel(int id)
{
@@ -338,23 +337,23 @@ CPed::AimGun(void)
CVector vector;
if (m_pSeekTarget) {
- if (m_pSeekTarget->m_status == STATUS_PHYSICS) {
- m_pSeekTarget->m_pedIK.GetComponentPosition(&pos, PED_TORSO);
+ if (m_pSeekTarget->IsPed()) {
+ ((CPed*)m_pSeekTarget)->m_pedIK.GetComponentPosition(&pos, PED_TORSO);
vector.x = pos.x;
vector.y = pos.y;
vector.z = pos.z;
} else {
vector = *(m_pSeekTarget->GetPosition());
}
- CPed::Say(SOUND_PED_ATTACK);
+ Say(SOUND_PED_ATTACK);
bCanPointGunAtTarget = m_pedIK.PointGunAtPosition(&vector);
if (m_pLookTarget != m_pSeekTarget) {
- CPed::SetLookFlag(m_pSeekTarget, 1);
+ SetLookFlag(m_pSeekTarget, 1);
}
} else {
- if (CPed::IsPlayer()) {
+ if (IsPlayer()) {
bCanPointGunAtTarget = m_pedIK.PointGunInDirection(m_fLookDirection, ((CPlayerPed*)this)->m_fFPSMoveHeading);
} else {
bCanPointGunAtTarget = m_pedIK.PointGunInDirection(m_fLookDirection, 0.0f);
@@ -459,7 +458,7 @@ CPed::RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data)
}
void
-CPed::SetLookFlag(CPed *target, bool unknown)
+CPed::SetLookFlag(CEntity *target, bool unknown)
{
if (m_lookTimer < CTimer::GetTimeInMilliseconds()) {
bIsLooking = true;
@@ -621,8 +620,7 @@ CPed::FinishedAttackCB(CAnimBlendAssociation *attackAssoc, void *arg)
if (attackAssoc) {
switch (attackAssoc->animId) {
case ANIM_WEAPON_START_THROW:
- if ((!ped->IsPlayer() || ((CPlayerPed*)ped)->field_1380) && ped->IsPlayer())
- {
+ if ((!ped->IsPlayer() || ((CPlayerPed*)ped)->field_1380) && ped->IsPlayer()) {
attackAssoc->blendDelta = -1000.0f;
newAnim = CAnimManager::AddAnimation((RpClump*)ped->m_rwObject, ASSOCGRP_STD, ANIM_WEAPON_THROWU);
} else {
@@ -1492,7 +1490,7 @@ STARTPATCHES
InjectHook(0x4C6AA0, &CPed::AimGun, PATCH_JUMP);
InjectHook(0x4EB470, &CPed::ApplyHeadShot, PATCH_JUMP);
InjectHook(0x4EAEE0, &CPed::RemoveBodyPart, PATCH_JUMP);
- InjectHook(0x4C6460, (void (CPed::*)(CPed*, bool)) &CPed::SetLookFlag, PATCH_JUMP);
+ InjectHook(0x4C6460, (void (CPed::*)(CEntity*, bool)) &CPed::SetLookFlag, PATCH_JUMP);
InjectHook(0x4C63E0, (void (CPed::*)(float, bool)) &CPed::SetLookFlag, PATCH_JUMP);
InjectHook(0x4D12E0, &CPed::SetLookTimer, PATCH_JUMP);
InjectHook(0x4C5700, &CPed::OurPedCanSeeThisOne, PATCH_JUMP);
diff --git a/src/entities/Ped.h b/src/entities/Ped.h
index 34c7a485..37a1cd3d 100644
--- a/src/entities/Ped.h
+++ b/src/entities/Ped.h
@@ -227,7 +227,7 @@ public:
CVector m_vecOffsetFromPhysSurface;
CEntity *m_pCurSurface;
uint8 stuff3[12];
- CPed *m_pSeekTarget;
+ CEntity *m_pSeekTarget;
CVehicle *m_pMyVehicle;
bool bInVehicle;
uint8 stuff4[23];
@@ -273,7 +273,7 @@ public:
void AimGun(void);
void KillPedWithCar(CVehicle *veh, float impulse);
void Say(uint16 audio);
- void SetLookFlag(CPed *target, bool unknown);
+ void SetLookFlag(CEntity *target, bool unknown);
void SetLookFlag(float direction, bool unknown);
void SetLookTimer(int time);
void SetDie(AnimationId anim, float arg1, float arg2);