summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-10 14:56:56 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-10 14:56:56 +0200
commit2ef5e4cd662d642b839a9e65b3176335c6b50448 (patch)
tree5e0a6dcdbf8f1566974c0514986ab7b61e5c067a /src/peds
parentPhone start, ped spinning and cop car fix, and some love to CPed (diff)
parentfixed COMMAND_IS_PLAYER_IN_AREA_3D (diff)
downloadre3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.gz
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.bz2
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.lz
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.xz
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.tar.zst
re3-2ef5e4cd662d642b839a9e65b3176335c6b50448.zip
Diffstat (limited to 'src/peds')
-rw-r--r--src/peds/Ped.cpp24
-rw-r--r--src/peds/Ped.h3
-rw-r--r--src/peds/PlayerPed.cpp16
-rw-r--r--src/peds/PlayerPed.h6
4 files changed, 37 insertions, 12 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index cce5d6a9..8ebe456f 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"
@@ -28,6 +29,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); }
@@ -432,7 +434,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;
@@ -671,7 +673,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);
@@ -1542,7 +1544,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
@@ -1661,7 +1663,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);
}
@@ -1774,12 +1776,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);
@@ -1881,7 +1883,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;
@@ -2090,7 +2092,7 @@ CPed::CalculateNewOrientation(void)
if (CReplay::IsPlayingBack() || !IsPedInControl())
return;
- CVector pos = *GetPosition();
+ CVector pos = GetPosition();
GetMatrix().SetRotate(0.0f, 0.0f, m_fRotationCur);
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 4909a583..cd7d88af 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;
@@ -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..4b484a7f 100644
--- a/src/peds/PlayerPed.cpp
+++ b/src/peds/PlayerPed.cpp
@@ -10,6 +10,9 @@ CPlayerPed::~CPlayerPed()
}
WRAPPER void CPlayerPed::ReApplyMoveAnims(void) { EAXJMP(0x4F07C0); }
+WRAPPER void CPlayerPed::SetupPlayerPed(int32) { EAXJMP(0x4EFB60); }
+WRAPPER void CPlayerPed::DeactivatePlayerPed(int32) { EAXJMP(0x4EFC00); }
+WRAPPER void CPlayerPed::ReactivatePlayerPed(int32) { EAXJMP(0x4EFC20); }
void CPlayerPed::ClearWeaponTarget()
{
@@ -21,6 +24,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..51a45203 100644
--- a/src/peds/PlayerPed.h
+++ b/src/peds/PlayerPed.h
@@ -43,6 +43,12 @@ public:
void ReApplyMoveAnims(void);
void ClearWeaponTarget();
+ void SetWantedLevel(int32 level);
+ void SetWantedLevelNoDrop(int32 level);
+
+ static void SetupPlayerPed(int32);
+ static void DeactivatePlayerPed(int32);
+ static void ReactivatePlayerPed(int32);
};
static_assert(sizeof(CPlayerPed) == 0x5F0, "CPlayerPed: error");