mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-07-03 20:35:51 +00:00
CScriptWaypoint: Brace conditionals where applicable
Makes the code consistent.
This commit is contained in:
parent
717d422fc4
commit
f78c85f37c
@ -38,9 +38,11 @@ void CScriptWaypoint::AddToRenderer(const zeus::CFrustum&, CStateManager&) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
TUniqueId CScriptWaypoint::FollowWaypoint(CStateManager& mgr) const {
|
TUniqueId CScriptWaypoint::FollowWaypoint(CStateManager& mgr) const {
|
||||||
for (const SConnection& conn : x20_conns)
|
for (const SConnection& conn : x20_conns) {
|
||||||
if (conn.x0_state == EScriptObjectState::Arrived && conn.x4_msg == EScriptObjectMessage::Follow)
|
if (conn.x0_state == EScriptObjectState::Arrived && conn.x4_msg == EScriptObjectMessage::Follow) {
|
||||||
return mgr.GetIdForScript(conn.x8_objId);
|
return mgr.GetIdForScript(conn.x8_objId);
|
||||||
|
}
|
||||||
|
}
|
||||||
return kInvalidUniqueId;
|
return kInvalidUniqueId;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,16 +50,20 @@ TUniqueId CScriptWaypoint::NextWaypoint(CStateManager& mgr) const {
|
|||||||
rstl::reserved_vector<TUniqueId, 10> ids;
|
rstl::reserved_vector<TUniqueId, 10> ids;
|
||||||
for (const SConnection& conn : x20_conns) {
|
for (const SConnection& conn : x20_conns) {
|
||||||
if (conn.x0_state == EScriptObjectState::Arrived && conn.x4_msg == EScriptObjectMessage::Next) {
|
if (conn.x0_state == EScriptObjectState::Arrived && conn.x4_msg == EScriptObjectMessage::Next) {
|
||||||
TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
|
const TUniqueId id = mgr.GetIdForScript(conn.x8_objId);
|
||||||
if (id != kInvalidUniqueId)
|
if (id != kInvalidUniqueId) {
|
||||||
if (TCastToConstPtr<CScriptWaypoint> wp = mgr.GetObjectById(id))
|
if (const TCastToConstPtr<CScriptWaypoint> wp = mgr.GetObjectById(id)) {
|
||||||
if (wp->GetActive())
|
if (wp->GetActive()) {
|
||||||
ids.push_back(wp->GetUniqueId());
|
ids.push_back(wp->GetUniqueId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ids.size() == 0)
|
if (ids.empty()) {
|
||||||
return kInvalidUniqueId;
|
return kInvalidUniqueId;
|
||||||
|
}
|
||||||
|
|
||||||
return ids[int(mgr.GetActiveRandom()->Float() * ids.size() * 0.99f)];
|
return ids[int(mgr.GetActiveRandom()->Float() * ids.size() * 0.99f)];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user