summaryrefslogtreecommitdiffstats
path: root/src/entities/Ped.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-04 09:15:30 +0200
committerGitHub <noreply@github.com>2019-07-04 09:15:30 +0200
commitfc011d76b46ea5881d7b9c5e701044df917a58d1 (patch)
tree77949cc32155e844b34c75f856f79ff3f3ad9cec /src/entities/Ped.h
parentMerge pull request #107 from Nick007J/master (diff)
parentMerge branch 'master' of git://github.com/GTAmodding/re3 into erorcun (diff)
downloadre3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar.gz
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar.bz2
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar.lz
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar.xz
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.tar.zst
re3-fc011d76b46ea5881d7b9c5e701044df917a58d1.zip
Diffstat (limited to 'src/entities/Ped.h')
-rw-r--r--src/entities/Ped.h108
1 files changed, 89 insertions, 19 deletions
diff --git a/src/entities/Ped.h b/src/entities/Ped.h
index 92fa32c1..558ec9c1 100644
--- a/src/entities/Ped.h
+++ b/src/entities/Ped.h
@@ -13,6 +13,45 @@
struct CPathNode;
+enum eObjective {
+ OBJECTIVE_NONE,
+ OBJECTIVE_IDLE,
+ OBJECTIVE_FLEE_TILL_SAFE,
+ OBJECTIVE_GUARD_SPOT,
+ OBJECTIVE_GUARD_AREA,
+ OBJECTIVE_WAIT_IN_CAR,
+ OBJECTIVE_WAIT_IN_CAR_THEN_GETOUT,
+ OBJECTIVE_KILL_CHAR_ON_FOOT,
+ OBJECTIVE_KILL_CHAR_ANY_MEANS,
+ OBJECTIVE_FLEE_CHAR_ON_FOOT_TILL_SAFE,
+ OBJECTIVE_FLEE_CHAR_ON_FOOT_ALWAYS,
+ OBJECTIVE_GOTO_CHAR_ON_FOOT,
+ OBJECTIVE_FOLLOW_PED_IN_FORMATION,
+ OBJECTIVE_LEAVE_VEHICLE,
+ OBJECTIVE_ENTER_CAR_AS_PASSENGER,
+ OBJECTIVE_ENTER_CAR_AS_DRIVER,
+ OBJECTIVE_FOLLOW_CAR_IN_CAR,
+ OBJECTIVE_FIRE_AT_OBJ_FROM_VEHICLE,
+ OBJECTIVE_DESTROY_OBJ,
+ OBJECTIVE_DESTROY_CAR,
+ OBJECTIVE_GOTO_AREA_ANY_MEANS,
+ OBJECTIVE_GOTO_AREA_ON_FOOT,
+ OBJECTIVE_RUN_TO_AREA,
+ OBJECTIVE_23,
+ OBJECTIVE_24,
+ OBJECTIVE_FIGHT_CHAR,
+ OBJECTIVE_SET_LEADER,
+ OBJECTIVE_FOLLOW_ROUTE,
+ OBJECTIVE_SOLICIT,
+ OBJECTIVE_HAIL_TAXI,
+ OBJECTIVE_CATCH_TRAIN,
+ OBJECTIVE_BUY_ICE_CREAM,
+ OBJECTIVE_STEAL_ANY_CAR,
+ OBJECTIVE_MUG_CHAR,
+ OBJECTIVE_FLEE_CAR,
+ OBJECTIVE_35
+};
+
enum {
VEHICLE_ENTER_FRONT_RIGHT = 11,
VEHICLE_ENTER_REAR_RIGHT = 12,
@@ -20,6 +59,11 @@ enum {
VEHICLE_ENTER_REAR_LEFT = 16,
};
+enum {
+ CREATED_BY_RANDOM = 1,
+ CREATED_BY_SCRIPT
+};
+
enum PedLineUpPhase {
LINE_UP_TO_CAR_START,
LINE_UP_TO_CAR_END,
@@ -97,7 +141,7 @@ enum PedState
PED_ARRESTED = 56,
};
-enum {
+enum eMoveState {
PEDMOVE_NONE,
PEDMOVE_STILL,
PEDMOVE_WALK,
@@ -146,7 +190,7 @@ public:
uint8 m_ped_flagD8 : 1;
uint8 m_ped_flagD10 : 1;
uint8 m_ped_flagD20 : 1;
- uint8 m_ped_flagD40 : 1;
+ uint8 m_ped_flagD40 : 1; // reset when objective changes
uint8 m_ped_flagD80 : 1;
uint8 m_ped_flagE1 : 1;
@@ -197,14 +241,14 @@ public:
uint8 m_nCreatedBy;
uint8 field_161;
uint8 pad_162[2];
- uint32 m_objective;
- uint32 m_prevObjective;
- CPed* m_field_16C;
- uint32 field_170;
+ eObjective m_objective;
+ eObjective m_prevObjective;
+ CPed *m_pedInObjective;
+ CVehicle *m_carInObjective;
uint32 field_174;
uint32 field_178;
uint32 field_17C;
- uint32 field_180;
+ CPed *m_leader;
uint32 m_pedFormation;
uint32 m_fearFlags;
CEntity *m_threatEntity;
@@ -223,7 +267,7 @@ public:
uint32 m_nPedStateTimer;
PedState m_nPedState;
PedState m_nLastPedState;
- int32 m_nMoveState;
+ eMoveState m_nMoveState;
int32 m_nStoredActionState;
int32 m_nPrevActionState;
int32 m_nWaitState;
@@ -246,8 +290,7 @@ public:
uint16 m_routeType;
uint16 m_routeCurDir;
uint16 field_2D2;
- float m_movedX;
- float m_movedY;
+ CVector2D m_moved;
float m_fRotationCur;
float m_fRotationDest;
float m_headingRate;
@@ -304,7 +347,7 @@ public:
uint32 m_attackTimer;
uint32 m_lastHitTime;
uint32 m_hitRecoverTimer;
- uint32 field_4E0;
+ uint32 m_objectiveTimer;
uint32 m_duckTimer;
uint32 field_4E8;
int32 m_bloodyFootprintCount;
@@ -345,9 +388,6 @@ public:
CPed* ctor(uint32 pedType) { return ::new (this) CPed(pedType); }
void dtor(void) { this->CPed::~CPed(); }
- bool IsPlayer(void);
- bool UseGroundColModel(void);
- bool CanSetPedState(void);
void AddWeaponModel(int id);
void AimGun(void);
void KillPedWithCar(CVehicle *veh, float impulse);
@@ -369,7 +409,6 @@ public:
bool IsPedHeadAbovePos(float zOffset);
void RemoveWeaponModel(int modelId);
void SetCurrentWeapon(uint32 weaponType);
- bool SelectGunIfArmed(void);
void Duck(void);
void ClearDuck(void);
void ClearPointGunAt(void);
@@ -379,14 +418,22 @@ public:
void SetPedPositionInCar(void);
void PlayFootSteps(void);
void QuitEnteringCar(void);
- bool IsPointerValid(void);
- void SortPeds(CPed**, int, int);
void BuildPedLists(void);
uint32 GiveWeapon(eWeaponType weaponType, uint32 ammo);
- void SetPedStats(ePedStats);
+ void CalculateNewOrientation(void);
+ float WorkOutHeadingForMovingFirstPerson(float);
+ void CalculateNewVelocity(void);
+ bool CanPedJumpThis(int32);
+ bool CanSeeEntity(CEntity*, float);
+ void RestorePreviousObjective(void);
+ void SetObjective(eObjective, void*);
+
+ // Static methods
static void GetLocalPositionToOpenCarDoor(CVector *output, CVehicle *veh, uint32 enterType, float offset);
static void GetPositionToOpenCarDoor(CVector *output, CVehicle *veh, uint32 enterType, float seatPosMult);
static void GetPositionToOpenCarDoor(CVector* output, CVehicle* veh, uint32 enterType);
+
+ // Callbacks
static RwObject *SetPedAtomicVisibilityCB(RwObject *object, void *data);
static RwFrame *RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data);
static void PedGetupCB(CAnimBlendAssociation *assoc, void *arg);
@@ -416,6 +463,26 @@ public:
static void PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
static void PedSetDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
+ // functions that I see unnecessary to hook
+ bool IsPlayer(void);
+ bool UseGroundColModel(void);
+ bool CanSetPedState(void);
+ bool IsPedInControl(void);
+ bool CanPedDriveOff(void);
+ bool CanBeDeleted(void);
+ bool CanStrafeOrMouseControl(void);
+ bool CanPedReturnToState(void);
+ void SetMoveState(eMoveState);
+ bool IsTemporaryObjective(eObjective objective);
+ void SetObjectiveTimer(int);
+ bool SelectGunIfArmed(void);
+ bool IsPointerValid(void);
+ void SortPeds(CPed**, int, int);
+ void ForceStoredObjective(eObjective);
+ void SetStoredObjective(void);
+ void SetLeader(CEntity* leader);
+ void SetPedStats(ePedStats);
+
inline bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
inline CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }
inline CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; }
@@ -424,6 +491,9 @@ public:
// to make patching virtual functions possible
void SetModelIndex_(uint32 mi) { CPed::SetModelIndex(mi); }
void FlagToDestroyWhenNextProcessed_(void) { CPed::FlagToDestroyWhenNextProcessed(); }
+ bool SetupLighting_(void) { return CPed::SetupLighting(); }
+ void RemoveLighting_(bool reset) { CPed::RemoveLighting(reset); }
+ void Teleport_(CVector pos) { CPed::Teleport(pos); }
// set by 0482:set_threat_reaction_range_multiplier opcode
static uint16 &distanceMultToCountPedNear;
@@ -447,6 +517,6 @@ static_assert(offsetof(CPed, m_weapons) == 0x35C, "CPed: error");
static_assert(offsetof(CPed, m_currentWeapon) == 0x498, "CPed: error");
static_assert(offsetof(CPed, m_lookTimer) == 0x4CC, "CPed: error");
static_assert(offsetof(CPed, m_bodyPartBleeding) == 0x4F2, "CPed: error");
-static_assert(offsetof(CPed, m_field_16C) == 0x16C, "CPed: error");
+static_assert(offsetof(CPed, m_pedInObjective) == 0x16C, "CPed: error");
static_assert(offsetof(CPed, m_pEventEntity) == 0x19C, "CPed: error");
static_assert(sizeof(CPed) == 0x53C, "CPed: error");