mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2025-01-23 23:31:11 +01:00
fixed ped attractor crash
This commit is contained in:
parent
bc42b3a78e
commit
fb80236214
@ -379,12 +379,16 @@ bool CPedAttractor::BroadcastDeparture(CPed* pPed)
|
|||||||
if (pPed->GetPedState() == PED_IDLE || pPed->GetPedState() == PED_NONE)
|
if (pPed->GetPedState() == PED_IDLE || pPed->GetPedState() == PED_NONE)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
||||||
}
|
}
|
||||||
else if (qid == 0)
|
else {
|
||||||
|
pPed->SetObjective(OBJECTIVE_NONE);
|
||||||
|
if (qid == 0)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(vecQueueDir.x, vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(vecQueueDir.x, vecQueueDir.y));
|
||||||
else if (qid == vWaitingQueue.size() - 1)
|
else if (qid == vWaitingQueue.size() - 1)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
||||||
else
|
else
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.z));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.z));
|
||||||
|
UpdatePedStateOnDeparture(pPed);
|
||||||
|
}
|
||||||
vWaitingQueue.erase(vWaitingQueue.cbegin() + qid);
|
vWaitingQueue.erase(vWaitingQueue.cbegin() + qid);
|
||||||
for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) {
|
for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) {
|
||||||
CPed* pPed = *pPedIt;
|
CPed* pPed = *pPedIt;
|
||||||
@ -416,12 +420,16 @@ bool CPedShelterAttractor::BroadcastDeparture(CPed* pPed)
|
|||||||
if (pPed->GetPedState() == PED_IDLE || pPed->GetPedState() == PED_NONE)
|
if (pPed->GetPedState() == PED_IDLE || pPed->GetPedState() == PED_NONE)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
||||||
}
|
}
|
||||||
else if (qid == 0)
|
else {
|
||||||
|
pPed->SetObjective(OBJECTIVE_NONE);
|
||||||
|
if (qid == 0)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(vecQueueDir.x, vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(vecQueueDir.x, vecQueueDir.y));
|
||||||
else if (qid == vWaitingQueue.size() - 1)
|
else if (qid == vWaitingQueue.size() - 1)
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.x, -vecQueueDir.y));
|
||||||
else
|
else
|
||||||
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.z));
|
pPed->SetWanderPath(CGeneral::GetNodeHeadingFromVector(-vecQueueDir.y, -vecQueueDir.x));
|
||||||
|
UpdatePedStateOnDeparture(pPed);
|
||||||
|
}
|
||||||
vWaitingQueue.erase(vWaitingQueue.cbegin() + qid);
|
vWaitingQueue.erase(vWaitingQueue.cbegin() + qid);
|
||||||
for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) {
|
for (std::vector<CPed*>::iterator pPedIt = vApproachingQueue.begin(); pPedIt != vApproachingQueue.end(); ++pPedIt) {
|
||||||
CPed* pPed = *pPedIt;
|
CPed* pPed = *pPedIt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user