diff options
author | aap <aap@papnet.eu> | 2020-05-20 19:49:24 +0200 |
---|---|---|
committer | aap <aap@papnet.eu> | 2020-05-20 19:49:24 +0200 |
commit | 114208533a433d83117ef7a4e7c25a2fa59d3030 (patch) | |
tree | 172de606bc1a2e203f8ee5933a47e26370f90668 /src/peds/Ped.cpp | |
parent | Merge branch 'miami' of github.com:GTAmodding/re3 into miami (diff) | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
download | re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar.gz re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar.bz2 re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar.lz re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar.xz re3-114208533a433d83117ef7a4e7c25a2fa59d3030.tar.zst re3-114208533a433d83117ef7a4e7c25a2fa59d3030.zip |
Diffstat (limited to 'src/peds/Ped.cpp')
-rw-r--r-- | src/peds/Ped.cpp | 38 |
1 files changed, 20 insertions, 18 deletions
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp index 15c72330..12870236 100644 --- a/src/peds/Ped.cpp +++ b/src/peds/Ped.cpp @@ -595,9 +595,6 @@ CPed::CPed(uint32 pedType) : m_pedIK(this) #ifdef KANGAROO_CHEAT m_ped_flagI80 = false; #endif -#ifdef VC_PED_PORTS - bSomeVCflag1 = false; -#endif m_gangFlags = 0xFF; @@ -605,6 +602,10 @@ CPed::CPed(uint32 pedType) : m_pedIK(this) bTurnedAroundOnAttractor = false; bCarPassenger = false; bMiamiViceCop = false; +#ifdef VC_PED_PORTS + bHeadStuckInCollision = false; +#endif + bIsPlayerFriend = true; bDeadPedInFrontOfCar = false; if ((CGeneral::GetRandomNumber() & 3) == 0) @@ -10659,7 +10660,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(); @@ -10766,11 +10767,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; @@ -10840,15 +10841,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(); @@ -15337,10 +15338,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; @@ -15415,10 +15416,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; @@ -15505,7 +15506,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(); @@ -16039,8 +16040,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; |