diff options
author | erorcun <erorcunerorcun@hotmail.com.tr> | 2021-03-06 17:28:59 +0100 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-06-24 20:34:28 +0200 |
commit | 618d689dff9a22d9385abf36f5e364b38273b7cf (patch) | |
tree | 9378d463e73933c90dcf90be93da7c9bac3dbeb1 /src/peds/Population.cpp | |
parent | Fix quiet police scanner on OpenAL (diff) | |
download | re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar.gz re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar.bz2 re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar.lz re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar.xz re3-618d689dff9a22d9385abf36f5e364b38273b7cf.tar.zst re3-618d689dff9a22d9385abf36f5e364b38273b7cf.zip |
Diffstat (limited to 'src/peds/Population.cpp')
-rw-r--r-- | src/peds/Population.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 13ae95d2..3d4746d2 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -1434,7 +1434,7 @@ CPopulation::PlaceGangMembersInFormation(ePedType pedType, int pedAmount, CVecto CPed *createdPeds[5]; if (!TheCamera.IsSphereVisible(coors, 3.0f) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) { - if (CPedPlacement::IsPositionClearForPed(coors, 3.0f, -1, 0)) { + if (CPedPlacement::IsPositionClearForPed(coors, 3.0f, -1, nil)) { bool leaderFoundGround; float leaderGroundZ = CWorld::FindGroundZFor3DCoord(coors.x, coors.y, coors.z, &leaderFoundGround) + 1.0f; if (leaderFoundGround) { @@ -1514,7 +1514,7 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c if (!TheCamera.IsSphereVisible(coors, circleR) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) { - if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) { + if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, nil)) { int pedIdx = 0; CVector leaderPos; #ifdef FIX_BUGS @@ -1558,9 +1558,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c } bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false); - bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f); + bool notTooHighFromLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) >= 1.0f); - if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) { + if (!foundObstacle && memberCanSeeLeader && notTooHighFromLeader) { CPed* newPed = AddPed(pedType, gangModel, finalPos); if (newPed) { createdPeds[pedIdx++] = newPed; @@ -1573,6 +1573,9 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c newPed->bCanAttackPlayerWithCops = true; CVisibilityPlugins::SetClumpAlpha(newPed->GetClump(), 0); +#ifdef FIX_BUGS + createLeader = false; +#endif } // No. #ifndef FIX_BUGS @@ -1581,9 +1584,6 @@ CPopulation::PlaceGangMembersInCircle(ePedType pedType, int pedAmount, CVector c #endif } } -#ifdef FIX_BUGS - createLeader = false; -#endif } } if (pedIdx >= 3) { @@ -1623,7 +1623,7 @@ CPopulation::PlaceCouple(ePedType manType, int32 manModel, ePedType womanType, i return; if (!TheCamera.IsSphereVisible(coors, 1.5f) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) { - if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetModelInfo(manModel)->GetColModel()->boundingSphere.radius, -1, 0)) { + if (CPedPlacement::IsPositionClearForPed(coors, CModelInfo::GetModelInfo(manModel)->GetColModel()->boundingSphere.radius, -1, nil)) { bool manFoundGround; float manGroundZ = CWorld::FindGroundZFor3DCoord(coors.x, coors.y, coors.z, &manFoundGround) + 1.0f; if (manFoundGround) { @@ -1705,7 +1705,7 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group) if (!TheCamera.IsSphereVisible(coors, circleR) || MIN_CREATION_DIST * PedCreationDistMultiplier() <= (coors - FindPlayerPed()->GetPosition()).Magnitude2D()) { - if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, 0)) { + if (CPedPlacement::IsPositionClearForPed(coors, circleR, -1, nil)) { int pedIdx = 0; CVector leaderPos; #ifdef FIX_BUGS @@ -1730,6 +1730,7 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group) int pedModel = ChooseCivilianOccupation(group); CPedModelInfo *pedModelInfo = (CPedModelInfo*)CModelInfo::GetModelInfo(pedModel); + if (pedModelInfo->GetRwObject()) { CEntity* obstacles[6] = { nil, nil, nil, nil, nil, nil }; CPedPlacement::IsPositionClearForPed(finalPos, CModelInfo::GetModelInfo(pedModel)->GetColModel()->boundingSphere.radius, ARRAY_SIZE(obstacles), obstacles); @@ -1751,9 +1752,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group) } bool memberCanSeeLeader = createLeader ? true : CWorld::GetIsLineOfSightClear(finalPos, leaderPos, true, false, false, false, false, false, false); - bool notTooCloseToLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) < 1.0f); + bool notTooHighFromLeader = createLeader ? true : !(Abs(finalPos.z - leaderPos.z) >= 1.0f); - if (!foundObstacle && memberCanSeeLeader && notTooCloseToLeader) { + if (!foundObstacle && memberCanSeeLeader && notTooHighFromLeader) { CPed *newPed = AddPed(pedModelInfo->m_pedType, pedModel, finalPos); if (newPed) { createdPeds[pedIdx++] = newPed; @@ -1764,6 +1765,9 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group) newPed->m_fRotationCur = angle; newPed->m_fearFlags = 0; CVisibilityPlugins::SetClumpAlpha(newPed->GetClump(), 0); +#ifdef FIX_BUGS + createLeader = false; +#endif } // No. #ifndef FIX_BUGS @@ -1772,9 +1776,6 @@ CPopulation::PlaceMallPedsAsStationaryGroup(CVector const& coors, int32 group) #endif } } -#ifdef FIX_BUGS - createLeader = false; -#endif } } if (pedIdx >= 3) { |