From 2ae112fdf6b90bb4435dba34bcc2a23604e1e158 Mon Sep 17 00:00:00 2001 From: aap Date: Mon, 8 Jul 2019 21:37:47 +0200 Subject: more CAutomobile --- src/peds/Ped.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/peds') diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 692fc4f2..bf36d403 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -669,7 +669,7 @@ CPed::AimGun(void) vector.y = pos.y; vector.z = pos.z; } else { - vector = *(m_pSeekTarget->GetPosition()); + vector = m_pSeekTarget->GetPosition(); } Say(SOUND_PED_ATTACK); @@ -1540,7 +1540,7 @@ CPed::GetPositionToOpenCarDoor(CVector *output, CVehicle *veh, uint32 enterType, GetLocalPositionToOpenCarDoor(output, veh, enterType, offset); doorPos = Multiply3x3(vehMat, *output); - *output = *veh->GetPosition() + doorPos; + *output = veh->GetPosition() + doorPos; } void @@ -1659,7 +1659,7 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) CVector neededPos; if (phase == LINE_UP_TO_CAR_2) { - neededPos = *GetPosition(); + neededPos = GetPosition(); } else { GetPositionToOpenCarDoor(&neededPos, veh, m_vehEnterType, seatPosMult); } @@ -2087,7 +2087,7 @@ CPed::CalculateNewOrientation(void) if (CReplay::IsPlayingBack() || !IsPedInControl()) return; - CVector pos = *GetPosition(); + CVector pos = GetPosition(); GetMatrix().SetRotate(0.0f, 0.0f, m_fRotationCur); -- cgit v1.2.3 From 74fcbc8c0a6bbac8e8057655c5f1133e15c63656 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 9 Jul 2019 09:57:44 +0200 Subject: more CAutomobile --- src/peds/Ped.cpp | 15 ++++++++------- src/peds/Ped.h | 2 +- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'src/peds') diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index bf36d403..e0e0b913 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -10,6 +10,7 @@ #include "Ped.h" #include "PlayerPed.h" #include "General.h" +#include "SurfaceTable.h" #include "VisibilityPlugins.h" #include "AudioManager.h" #include "HandlingMgr.h" @@ -430,7 +431,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this) m_ped_flagI1 = false; m_ped_flagI2 = false; m_ped_flagI4 = false; - bRecordedForReplay = false; + bHasAlreadyBeenRecorded = false; m_ped_flagI10 = false; #ifdef KANGAROO_CHEAT m_ped_flagI80 = false; @@ -1772,12 +1773,12 @@ CPed::LineUpPedWithCar(PedLineUpPhase phase) static void particleProduceFootDust(CPed *ped, CVector *pos, float size, int times) { - switch (ped->m_nLastCollType) + switch (ped->m_nSurfaceTouched) { - case 1: // somewhere hard - case 3: // soft dirt - case 5: // pavement - case 18:// sand + case SURFACE_TARMAC: + case SURFACE_DIRT: + case SURFACE_PAVEMENT: + case SURFACE_SAND: for (int i = 0; i < times; ++i) { CVector adjustedPos = *pos; adjustedPos.x += CGeneral::GetRandomNumberInRange(-0.1f, 0.1f); @@ -1879,7 +1880,7 @@ CPed::PlayFootSteps(void) } } - if (m_nLastCollType == 19) { // Water + if (m_nSurfaceTouched == SURFACE_PUDDLE) { float pedSpeed = CVector2D(m_vecMoveSpeed).Magnitude(); if (pedSpeed > 0.03f && CTimer::GetFrameCounter() % 2 == 0 && pedSpeed > 0.13f) { float particleSize = pedSpeed * 2.0f; diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 2390d1d4..6aba79cf 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -251,7 +251,7 @@ public: uint8 m_ped_flagI1 : 1; uint8 m_ped_flagI2 : 1; uint8 m_ped_flagI4 : 1; - uint8 bRecordedForReplay : 1; + uint8 bHasAlreadyBeenRecorded : 1; uint8 m_ped_flagI10 : 1; uint8 m_ped_flagI20 : 1; uint8 m_ped_flagI40 : 1; -- cgit v1.2.3 From a65dd41da736a12866526abc1405cbaa154771a8 Mon Sep 17 00:00:00 2001 From: aap Date: Tue, 9 Jul 2019 18:50:35 +0200 Subject: yet more CAutomobile --- src/peds/Ped.cpp | 1 + src/peds/Ped.h | 1 + src/peds/PlayerPed.cpp | 13 +++++++++++++ src/peds/PlayerPed.h | 2 ++ 4 files changed, 17 insertions(+) (limited to 'src/peds') diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index e0e0b913..28cb8823 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -28,6 +28,7 @@ WRAPPER void CPed::KillPedWithCar(CVehicle *veh, float impulse) { EAXJMP(0x4EC430); } WRAPPER void CPed::Say(uint16 audio) { EAXJMP(0x4E5A10); } WRAPPER void CPed::SetDie(AnimationId anim, float arg1, float arg2) { EAXJMP(0x4D37D0); } +WRAPPER void CPed::SetDead(void) { EAXJMP(0x4D3970); } WRAPPER void CPed::SpawnFlyingComponent(int, int8) { EAXJMP(0x4EB060); } WRAPPER void CPed::RestorePreviousState(void) { EAXJMP(0x4C5E30); } WRAPPER void CPed::ClearAttack(void) { EAXJMP(0x4E6790); } diff --git a/src/peds/Ped.h b/src/peds/Ped.h index 6aba79cf..f48c30ba 100644 --- a/src/peds/Ped.h +++ b/src/peds/Ped.h @@ -414,6 +414,7 @@ public: void SetLookFlag(float direction, bool unknown); void SetLookTimer(int time); void SetDie(AnimationId anim, float arg1, float arg2); + void SetDead(void); void ApplyHeadShot(eWeaponType weaponType, CVector pos, bool evenOnPlayer); void RemoveBodyPart(PedNode nodeId, int8 unknown); void SpawnFlyingComponent(int, int8 unknown); diff --git a/src/peds/PlayerPed.cpp b/src/peds/PlayerPed.cpp index 07cb5541..43206e08 100644 --- a/src/peds/PlayerPed.cpp +++ b/src/peds/PlayerPed.cpp @@ -21,6 +21,19 @@ void CPlayerPed::ClearWeaponTarget() ClearPointGunAt(); } +void +CPlayerPed::SetWantedLevel(int32 level) +{ + m_pWanted->SetWantedLevel(level); +} + +void +CPlayerPed::SetWantedLevelNoDrop(int32 level) +{ + m_pWanted->SetWantedLevelNoDrop(level); +} + + class CPlayerPed_ : public CPlayerPed { public: diff --git a/src/peds/PlayerPed.h b/src/peds/PlayerPed.h index 1a106b38..8b617a43 100644 --- a/src/peds/PlayerPed.h +++ b/src/peds/PlayerPed.h @@ -43,6 +43,8 @@ public: void ReApplyMoveAnims(void); void ClearWeaponTarget(); + void SetWantedLevel(int32 level); + void SetWantedLevelNoDrop(int32 level); }; static_assert(sizeof(CPlayerPed) == 0x5F0, "CPlayerPed: error"); -- cgit v1.2.3