diff options
Diffstat (limited to 'src/peds/PedAttractor.cpp')
-rw-r--r-- | src/peds/PedAttractor.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/peds/PedAttractor.cpp b/src/peds/PedAttractor.cpp index 22e0e779..de587270 100644 --- a/src/peds/PedAttractor.cpp +++ b/src/peds/PedAttractor.cpp @@ -104,7 +104,7 @@ bool CVehicleToEffect::HasThisEffect(C2dEffect* pEffect) const const C2dEffect* CPedAttractorManager::GetEffectForIceCreamVan(CVehicle* pVehicle, const CVector& pos) { if (!vVehicleToEffect.empty()) { - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { + for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end(); ++assoc) { if (assoc->GetVehicle() == pVehicle) return assoc->ChooseEffect(pos); } @@ -120,7 +120,7 @@ CVehicle* CPedAttractorManager::GetIceCreamVanForEffect(C2dEffect* pEffect) { if (vVehicleToEffect.empty()) return nil; - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend(); ++assoc) { + for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end(); ++assoc) { if (assoc->HasThisEffect(pEffect)) return assoc->GetVehicle(); } @@ -131,7 +131,7 @@ const CPedAttractor* CPedAttractorManager::FindAssociatedAttractor(const C2dEffe { if (vecAttractors.empty()) return nil; - for (std::vector<CPedAttractor*>::const_iterator attractor = vecAttractors.cbegin(); attractor != vecAttractors.cend(); ++attractor) { + for (std::vector<CPedAttractor*>::const_iterator attractor = vecAttractors.begin(); attractor != vecAttractors.end(); ++attractor) { if ((*attractor)->GetEffect() == pEffect) return *attractor; } @@ -145,7 +145,7 @@ void CPedAttractorManager::RemoveIceCreamVanEffects(C2dEffect* pEffect) return; if (vVehicleToEffect.empty()) return; - for (std::vector<CVehicleToEffect>::const_iterator assoc = vVehicleToEffect.cbegin(); assoc != vVehicleToEffect.cend();) { + for (std::vector<CVehicleToEffect>::iterator assoc = vVehicleToEffect.begin(); assoc != vVehicleToEffect.end();) { if (assoc->GetVehicle() != pVehicle) { ++assoc; continue; @@ -229,7 +229,7 @@ CVector CPedShelterAttractor::GetDisplacement(int32 qid) const float fRandomOffset = CGeneral::GetRandomNumberInRange(0.0f, 2.0f); CVector vecDisplacement(fRandomOffset * Sin(fRandomAngle), fRandomOffset * Cos(fRandomAngle), 0.0f); bool close = false; - for (std::vector<CVector>::const_iterator v = ms_displacements.cbegin(); v != ms_displacements.cend(); ++v) { + for (std::vector<CVector>::const_iterator v = ms_displacements.begin(); v != ms_displacements.end(); ++v) { if ((*v - vecDisplacement).Magnitude() < 1.0f) { close = true; break; @@ -265,7 +265,7 @@ void CPedShelterAttractor::ComputeAttractHeading(int32 qid, float& heading) cons bool CPedAttractor::RegisterPed(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { vApproachingQueue.erase(pPedIt); return false; @@ -318,7 +318,7 @@ static bool IsPedUsingAttractorOfThisType(int8 type, CPed* pPed) bool CPedAttractor::DeRegisterPed(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt != pPed) continue; pPed->m_attractor = nil; @@ -340,12 +340,12 @@ bool CPedAttractor::DeRegisterPed(CPed* pPed) bool CPedAttractor::BroadcastArrival(CPed* pPed) { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return false; } vWaitingQueue.push_back(pPed); - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { vApproachingQueue.erase(pPedIt); break; @@ -400,7 +400,7 @@ bool CPedAttractor::BroadcastDeparture(CPed* pPed) pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.x)); UpdatePedStateOnDeparture(pPed); } - vWaitingQueue.erase(vWaitingQueue.cbegin() + qid); + vWaitingQueue.erase(vWaitingQueue.begin() + qid); for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { CPed* pPed = *pPedIt; CVector pos; @@ -441,7 +441,7 @@ bool CPedShelterAttractor::BroadcastDeparture(CPed* pPed) pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.x)); UpdatePedStateOnDeparture(pPed); } - vWaitingQueue.erase(vWaitingQueue.cbegin() + qid); + vWaitingQueue.erase(vWaitingQueue.begin() + qid); for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { CPed* pPed = *pPedIt; CVector pos; @@ -458,11 +458,11 @@ bool CPedShelterAttractor::BroadcastDeparture(CPed* pPed) bool CPedAttractor::IsRegisteredWithPed(CPed* pPed) const { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return true; } - for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.cbegin(); pPedIt != vApproachingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) { return true; } @@ -472,7 +472,7 @@ bool CPedAttractor::IsRegisteredWithPed(CPed* pPed) const bool CPedAttractor::IsInQueue(CPed* pPed) const { - for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.cbegin(); pPedIt != vWaitingQueue.cend(); ++pPedIt) { + for (std::vector<CPed*>::const_iterator pPedIt = vWaitingQueue.begin(); pPedIt != vWaitingQueue.end(); ++pPedIt) { if (*pPedIt == pPed) return true; } @@ -640,7 +640,7 @@ void CPedAttractorManager::ComputeEffectUseDir(const C2dEffect* pEffect, const C CPedAttractor* CPedAttractorManager::RegisterPed(CPed* pPed, C2dEffect* pEffect, const CMatrix& matrix, std::vector<CPedAttractor*>& vecAttractors) { CPedAttractor* pRegisteredAttractor = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { CPedAttractor* pAttractor = *pAttractorIt; CVector vEffectPos; ComputeEffectPos(pAttractor->GetEffect(), matrix, vEffectPos); @@ -676,7 +676,7 @@ bool CPedAttractorManager::DeRegisterPed(CPed* pPed, CPedAttractor* pAttractor, if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -687,7 +687,7 @@ bool CPedAttractorManager::DeRegisterPed(CPed* pPed, CPedAttractor* pAttractor, pFound->DeRegisterPed(pPed); if (pFound->GetNoOfRegisteredPeds() != 0) return true; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { vecAttractors.erase(pAttractorIt); break; @@ -702,7 +702,7 @@ bool CPedAttractorManager::BroadcastArrival(CPed* pPed, CPedAttractor* pAttracto if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -719,7 +719,7 @@ bool CPedAttractorManager::BroadcastDeparture(CPed* pPed, CPedAttractor* pAttrac if (!pAttractor) return false; CPedAttractor* pFound = nil; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { pFound = *pAttractorIt; break; @@ -730,7 +730,7 @@ bool CPedAttractorManager::BroadcastDeparture(CPed* pPed, CPedAttractor* pAttrac pFound->DeRegisterPed(pPed); if (pFound->GetNoOfRegisteredPeds() != 0) return true; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { vecAttractors.erase(pAttractorIt); break; @@ -744,7 +744,7 @@ bool CPedAttractorManager::IsInQueue(CPed* pPed, CPedAttractor* pAttractor, std: { if (!pAttractor) return false; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { return (*pAttractorIt)->IsInQueue(pPed); } @@ -756,7 +756,7 @@ bool CPedAttractorManager::IsAtHeadOfQueue(CPed* pPed, CPedAttractor* pAttractor { if (!pAttractor) return false; - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if (*pAttractorIt == pAttractor) { return (*pAttractorIt)->IsAtHeadOfQueue(pPed); } @@ -766,7 +766,7 @@ bool CPedAttractorManager::IsAtHeadOfQueue(CPed* pPed, CPedAttractor* pAttractor bool CPedAttractorManager::IsPedRegistered(CPed* pPed, std::vector<CPedAttractor*>& vecAttractors) { - for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.cbegin(); pAttractorIt != vecAttractors.cend(); ++pAttractorIt) { + for (std::vector<CPedAttractor*>::const_iterator pAttractorIt = vecAttractors.begin(); pAttractorIt != vecAttractors.end(); ++pAttractorIt) { if ((*pAttractorIt)->IsRegisteredWithPed(pPed)) return true; } |