mirror of https://github.com/AxioDL/metaforce.git
CDrone: Don't return early in Patrol
This commit is contained in:
parent
a2fe44afe1
commit
8a4cda9d98
|
@ -460,12 +460,12 @@ void CDrone::Patrol(CStateManager& mgr, EStateMsg msg, float dt) {
|
||||||
} else if (msg == EStateMsg::Update) {
|
} else if (msg == EStateMsg::Update) {
|
||||||
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
rstl::reserved_vector<TUniqueId, 1024> nearList;
|
||||||
BuildNearList(EMaterialTypes::Character, EMaterialTypes::Player, nearList, 5.f, mgr);
|
BuildNearList(EMaterialTypes::Character, EMaterialTypes::Player, nearList, 5.f, mgr);
|
||||||
if (nearList.empty())
|
if (!nearList.empty()) {
|
||||||
return;
|
zeus::CVector3f sep = x45c_steeringBehaviors.Separation(
|
||||||
zeus::CVector3f sep = x45c_steeringBehaviors.Separation(
|
*this, static_cast<const CActor*>(mgr.GetObjectById(nearList[0]))->GetTranslation(), 5.f);
|
||||||
*this, static_cast<const CActor*>(mgr.GetObjectById(nearList[0]))->GetTranslation(), 5.f);
|
if (!sep.isZero()) {
|
||||||
if (!sep.isZero()) {
|
x450_bodyController->GetCommandMgr().DeliverCmd(CBCLocomotionCmd(sep, zeus::skZero3f, 0.5f));
|
||||||
x450_bodyController->GetCommandMgr().DeliverCmd(CBCLocomotionCmd(sep, zeus::skZero3f, 0.5f));
|
}
|
||||||
}
|
}
|
||||||
} else if (msg == EStateMsg::Deactivate) {
|
} else if (msg == EStateMsg::Deactivate) {
|
||||||
SetLightEnabled(mgr, false);
|
SetLightEnabled(mgr, false);
|
||||||
|
|
Loading…
Reference in New Issue