summaryrefslogtreecommitdiffstats
path: root/src/peds
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-19 19:54:05 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-19 19:54:05 +0200
commit4c822e8375268ac34f92af3f1960965446d32506 (patch)
tree50c0d7d8c2514880f9148a2edc655954eb500191 /src/peds
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-4c822e8375268ac34f92af3f1960965446d32506.tar
re3-4c822e8375268ac34f92af3f1960965446d32506.tar.gz
re3-4c822e8375268ac34f92af3f1960965446d32506.tar.bz2
re3-4c822e8375268ac34f92af3f1960965446d32506.tar.lz
re3-4c822e8375268ac34f92af3f1960965446d32506.tar.xz
re3-4c822e8375268ac34f92af3f1960965446d32506.tar.zst
re3-4c822e8375268ac34f92af3f1960965446d32506.zip
Diffstat (limited to '')
-rw-r--r--src/peds/Ped.cpp38
-rw-r--r--src/peds/Ped.h18
2 files changed, 33 insertions, 23 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 91dafbc2..f7140b2b 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -619,14 +619,15 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
#ifdef KANGAROO_CHEAT
m_ped_flagI80 = false;
#endif
-#ifdef VC_PED_PORTS
- bSomeVCflag1 = false;
-#endif
bReachedAttractorHeadingTarget = false;
bTurnedAroundOnAttractor = false;
bCarPassenger = false;
bMiamiViceCop = false;
+#ifdef VC_PED_PORTS
+ bHeadStuckInCollision = false;
+#endif
+ bIsPlayerFriend = true;
bDeadPedInFrontOfCar = false;
if ((CGeneral::GetRandomNumber() & 3) == 0)
@@ -10662,7 +10663,7 @@ CPed::ProcessControl(void)
flyDir = 1;
}
- if (flyDir != 0 && !bSomeVCflag1) {
+ if (flyDir != 0 && !bHeadStuckInCollision) {
SetPosition((flyDir == 2 ? obstacleForFlyingOtherDir.point : obstacleForFlying.point));
GetMatrix().GetPosition().z += FEET_OFFSET;
GetMatrix().UpdateRW();
@@ -10769,11 +10770,11 @@ CPed::ProcessControl(void)
if (CWorld::ProcessVerticalLine(offsetToCheck, GetPosition().z - FEET_OFFSET, foundCol, foundEnt, true, true, false, true, false, false, nil)) {
#ifdef VC_PED_PORTS
- if (!bSomeVCflag1 || FEET_OFFSET + foundCol.point.z < GetPosition().z) {
+ if (!bHeadStuckInCollision || FEET_OFFSET + foundCol.point.z < GetPosition().z) {
GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z;
GetMatrix().UpdateRW();
- if (bSomeVCflag1)
- bSomeVCflag1 = false;
+ if (bHeadStuckInCollision)
+ bHeadStuckInCollision = false;
}
#else
GetMatrix().GetPosition().z = FEET_OFFSET + foundCol.point.z;
@@ -10843,15 +10844,15 @@ CPed::ProcessControl(void)
if (IsPedInControl() && !bIsStanding && !m_pDamageEntity && CheckIfInTheAir()) {
SetInTheAir();
#ifdef VC_PED_PORTS
- bSomeVCflag1 = false;
+ bHeadStuckInCollision = false;
#endif
}
#ifdef VC_PED_PORTS
- if (bSomeVCflag1) {
+ if (bHeadStuckInCollision) {
CVector posToCheck = GetPosition();
posToCheck.z += 0.9f;
if (!CWorld::TestSphereAgainstWorld(posToCheck, 0.2f, this, true, true, false, true, false, false))
- bSomeVCflag1 = false;
+ bHeadStuckInCollision = false;
}
#endif
ProcessObjective();
@@ -15339,10 +15340,10 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
if (CCollision::IsStoredPolyStillValidVerticalLine(pos, potentialGroundZ, intersectionPoint, &m_collPoly)) {
bStillOnValidPoly = true;
#ifdef VC_PED_PORTS
- if(!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
+ if(!bHeadStuckInCollision || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
- if (bSomeVCflag1)
- bSomeVCflag1 = false;
+ if (bHeadStuckInCollision)
+ bHeadStuckInCollision = false;
}
#else
GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
@@ -15417,10 +15418,10 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
}
}
#ifdef VC_PED_PORTS
- if (!bSomeVCflag1 || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
+ if (!bHeadStuckInCollision || FEET_OFFSET + intersectionPoint.point.z < GetPosition().z) {
GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
- if (bSomeVCflag1)
- bSomeVCflag1 = false;
+ if (bHeadStuckInCollision)
+ bHeadStuckInCollision = false;
}
#else
GetMatrix().GetPosition().z = FEET_OFFSET + intersectionPoint.point.z;
@@ -15507,7 +15508,7 @@ CPed::ProcessEntityCollision(CEntity *collidingEnt, CColPoint *collidingPoints)
sphereNormal.x = -m_vecMoveSpeed.x / Max(0.001f, speed);
sphereNormal.y = -m_vecMoveSpeed.y / Max(0.001f, speed);
GetMatrix().GetPosition().z -= 0.05f;
- bSomeVCflag1 = true;
+ bHeadStuckInCollision = true;
}
#endif
sphereNormal.Normalise();
@@ -16038,8 +16039,9 @@ CPed::SetSolicit(uint32 time)
}
bool
-CPed::SetFollowPath(CVector dest)
+CPed::SetFollowPath(CVector dest, float radius, eMoveState state, CEntity* pFollowedPed, CEntity*, int time)
{
+ // TODO(MIAMI): new follow
if (m_nPedState == PED_FOLLOW_PATH)
return false;
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 1fa36b05..f34de765 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -418,9 +418,6 @@ public:
uint32 bVehExitWillBeInstant : 1;
uint32 bHasAlreadyBeenRecorded : 1;
uint32 bFallenDown : 1;
-#ifdef VC_PED_PORTS
- uint32 bSomeVCflag1 : 1;
-#endif
#ifdef PED_SKIN
uint32 bDontAcceptIKLookAts : 1; // TODO: find uses of this
#endif
@@ -433,6 +430,10 @@ public:
uint32 bHasAlreadyUsedAttractor : 1; // 0x155 0x1
uint32 bCarPassenger : 1; // 0x155 0x4
uint32 bMiamiViceCop : 1; // 0x155 0x20
+ uint32 bIsPlayerFriend : 1; // 0x156 0x10
+#ifdef VC_PED_PORTS
+ uint32 bHeadStuckInCollision : 1; // 0x156 0x20
+#endif
uint32 bDeadPedInFrontOfCar : 1; // 0x156 0x40
uint8 CharCreatedBy;
@@ -666,7 +667,9 @@ public:
void SetPointGunAt(CEntity*);
bool Seek(void);
bool SetWanderPath(int8);
- bool SetFollowPath(CVector);
+ bool SetFollowPath(CVector dest, float radius, eMoveState state, CEntity*, CEntity*, int);
+ bool SetFollowPathStatic(void);
+ bool SetFollowPathDynamic(void);
void ClearAttackByRemovingAnim(void);
void SetStoredState(void);
void StopNonPartialAnims(void);
@@ -873,7 +876,12 @@ public:
CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; }
PedState GetPedState(void) { return m_nPedState; }
- void SetPedState(PedState state) { m_nPedState = state; }
+ void SetPedState(PedState state)
+ {
+ if (GetPedState() == PED_FOLLOW_PATH)
+ ClearFollowPath();
+ m_nPedState = state;
+ }
bool Dead(void) { return m_nPedState == PED_DEAD; }
bool Dying(void) { return m_nPedState == PED_DIE; }
bool DyingOrDead(void) { return m_nPedState == PED_DIE || m_nPedState == PED_DEAD; }