diff options
Diffstat (limited to '')
-rw-r--r-- | src/entities/Ped.cpp | 61 | ||||
-rw-r--r-- | src/entities/Ped.h | 15 | ||||
-rw-r--r-- | src/entities/PedIK.h | 7 |
3 files changed, 37 insertions, 46 deletions
diff --git a/src/entities/Ped.cpp b/src/entities/Ped.cpp index fbd59b3e..8d51c1f2 100644 --- a/src/entities/Ped.cpp +++ b/src/entities/Ped.cpp @@ -1,10 +1,12 @@ #include "common.h" #include "patcher.h" -#include "Ped.h" #include "Pools.h" #include "Particle.h" #include "Stats.h" #include "World.h" +#include "PedStat.h" +#include "DMaudio.h" +#include "Ped.h" Bool &CPed::bNastyLimbsCheat = *(Bool*)0x95CD44; Bool &CPed::bPedCheat2 = *(Bool*)0x95CD5A; @@ -14,9 +16,9 @@ void *CPed::operator new(size_t sz) { return CPools::GetPedPool()->New(); } void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); } WRAPPER void CPed::KillPedWithCar(CVehicle *veh, float impulse) { EAXJMP(0x4EC430); } -WRAPPER void CPed::Say(eSound audio) { EAXJMP(0x4E5A10); } +WRAPPER void CPed::Say(uint16 audio) { EAXJMP(0x4E5A10); } WRAPPER void CPed::SetDie(AnimationId anim, float arg1, float arg2) { EAXJMP(0x4D37D0); } -WRAPPER void CPed::SpawnFlyingComponent(int, signed char) { EAXJMP(0x4EB060); } +WRAPPER void CPed::SpawnFlyingComponent(int, int8) { EAXJMP(0x4EB060); } static char ObjectiveText[34][28] = { "No Obj", @@ -250,38 +252,27 @@ CPed::ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer) m_nPedStateTimer = CTimer::GetTimeInMilliseconds() + 150; CParticle::AddParticle(PARTICLE_TEST, pos2, - CVector( - 0.0f, - 0.0f, - 0.0f - ), NULL, 0.2f, 0, 0, 0, 0); + CVector(0.0f, 0.0f, 0.0f), nil, 0.2f, 0, 0, 0, 0); if (CEntity::GetIsOnScreen()) { for(int i=0; i < 32; i++) { CParticle::AddParticle(PARTICLE_BLOOD_SMALL, - pos2, - CVector( - 0.0f, - 0.0f, - 0.03f - ), NULL, 0.0f, 0, 0, 0, 0); + pos2, CVector(0.0f, 0.0f, 0.03f), + nil, 0.0f, 0, 0, 0, 0); } for (int i = 0; i < 16; i++) { CParticle::AddParticle(PARTICLE_DEBRIS2, - pos2, - CVector( - 0.0f, - 0.0f, - 0.01f - ), NULL, 0.0f, 0, 0, 0, 0); + pos2, + CVector(0.0f, 0.0f, 0.01f), + nil, 0.0f, 0, 0, 0, 0); } } } } void -CPed::RemoveBodyPart(PedNode nodeId, char arg4) +CPed::RemoveBodyPart(PedNode nodeId, int8 unk) { RwFrame *frame; RwFrame *fp; @@ -291,7 +282,7 @@ CPed::RemoveBodyPart(PedNode nodeId, char arg4) if (frame) { if (CGame::nastyGame) { if (nodeId != PED_HEAD) - CPed::SpawnFlyingComponent(nodeId, arg4); + CPed::SpawnFlyingComponent(nodeId, unk); RecurseFrameChildrenVisibilityCB(frame, 0); zero.x = 0.0f; @@ -302,20 +293,14 @@ CPed::RemoveBodyPart(PedNode nodeId, char arg4) if (CEntity::GetIsOnScreen()) { CParticle::AddParticle(PARTICLE_TEST, zero, - CVector( - 0.0f, - 0.0f, - 0.0f - ), NULL, 0.2f, 0, 0, 0, 0); + CVector(0.0f, 0.0f, 0.0f), + nil, 0.2f, 0, 0, 0, 0); for (int i = 0; i < 16; i++) { CParticle::AddParticle(PARTICLE_BLOOD_SMALL, zero, - CVector( - 0.0f, - 0.0f, - 0.03f - ), NULL, 0.0f, 0, 0, 0, 0); + CVector(0.0f, 0.0f, 0.03f), + nil, 0.0f, 0, 0, 0, 0); } } m_ped_flagC20 = 1; @@ -329,11 +314,9 @@ CPed::RemoveBodyPart(PedNode nodeId, char arg4) RwObject* CPed::SetPedAtomicVisibilityCB(RwObject *object, void *data) { - RwObject *result = object; - if (!data) + if (data == 0) RpAtomicSetFlags(object, 0); - - return result; + return object; } RwFrame* @@ -356,7 +339,7 @@ CPed::SetLookFlag(CPed *to, bool set) m_lookTimer = 0; m_ped_flagA20_look = set; if (m_nPedState != PED_DRIVING) { - m_pedIK.m_flags &= ~(1 << 2); + m_pedIK.m_flags &= ~CPedIK::FLAG_4; } } } @@ -372,7 +355,7 @@ CPed::SetLookFlag(float angle, bool set) m_lookTimer = 0; m_ped_flagA20_look = set; if (m_nPedState != PED_DRIVING) { - m_pedIK.m_flags &= ~(1 << 2); + m_pedIK.m_flags &= ~CPedIK::FLAG_4; } } } @@ -411,7 +394,7 @@ CPed::OurPedCanSeeThisOne(CEntity* who) return 0; ourPos.z += 1.0f; - return CWorld::ProcessLineOfSight(ourPos, itsPos, colpoint, ent, 1, 0, 0, 0, 0, 0, 0) == 0; + return !CWorld::ProcessLineOfSight(ourPos, itsPos, colpoint, ent, 1, 0, 0, 0, 0, 0, 0); } STARTPATCHES diff --git a/src/entities/Ped.h b/src/entities/Ped.h index 2143fa93..6a2f8ef1 100644 --- a/src/entities/Ped.h +++ b/src/entities/Ped.h @@ -2,12 +2,12 @@ #include "Physical.h" #include "Weapon.h" -#include "PathFind.h" #include "PedIK.h" #include "AnimManager.h" #include "AnimBlendClumpData.h" -#include "PedStat.h" -#include "DMAudio.h" + +struct PedStat; +struct CPathNode; enum { PED_MAX_WEAPONS = 13 @@ -234,25 +234,26 @@ public: static void *operator new(size_t); static void operator delete(void*, size_t); + // TODO: enum! bool IsPlayer(void) { return m_nPedType == 0 || m_nPedType== 1 || m_nPedType == 2 || m_nPedType == 3; } bool UseGroundColModel(void); void AddWeaponModel(int id); void AimGun(); void KillPedWithCar(CVehicle *veh, float impulse); - void Say(eSound audio); + void Say(uint16 audio); void SetLookFlag(CPed *to, bool set); void SetLookFlag(float angle, bool set); void SetLookTimer(int time); void SetDie(AnimationId anim, float arg1, float arg2); void ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer); - void RemoveBodyPart(PedNode nodeId, char arg4); - void SpawnFlyingComponent(int, signed char); + void RemoveBodyPart(PedNode nodeId, int8 unknown); + void SpawnFlyingComponent(int, int8 unknown); bool OurPedCanSeeThisOne(CEntity* who); static RwObject *SetPedAtomicVisibilityCB(RwObject *object, void *data); static RwFrame *RecurseFrameChildrenVisibilityCB(RwFrame *frame, void *data); CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; } - RwFrame* GetNodeFrame(int nodeId) { return m_pFrames[nodeId]->frame; } + RwFrame *GetNodeFrame(int nodeId) { return m_pFrames[nodeId]->frame; } static Bool &bNastyLimbsCheat; static Bool &bPedCheat2; diff --git a/src/entities/PedIK.h b/src/entities/PedIK.h index ecb17777..67aaa469 100644 --- a/src/entities/PedIK.h +++ b/src/entities/PedIK.h @@ -12,6 +12,13 @@ class CPed; class CPedIK { public: + // TODO + enum { + FLAG_1, + FLAG_2, + FLAG_4, + }; + CPed* m_ped; LimbOrientation m_headOrient; LimbOrientation m_torsoOrient; |