mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 21:47:42 +00:00
Work on CBallCamera
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "CScriptCameraWaypoint.hpp"
|
||||
#include "CActorParameters.hpp"
|
||||
#include "TCastTo.hpp"
|
||||
#include "CStateManager.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
@@ -27,4 +28,24 @@ void CScriptCameraWaypoint::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId
|
||||
SendScriptMsgs(EScriptObjectState::Arrived, mgr, EScriptObjectMessage::None);
|
||||
}
|
||||
|
||||
TUniqueId CScriptCameraWaypoint::GetRandomNextWaypointId(CStateManager& mgr) const
|
||||
{
|
||||
std::vector<TUniqueId> candidateIds;
|
||||
for (const SConnection& conn : x20_conns)
|
||||
{
|
||||
if (conn.x0_state == EScriptObjectState::Arrived && conn.x4_msg == EScriptObjectMessage::Next)
|
||||
{
|
||||
TUniqueId uid = mgr.GetIdForScript(conn.x8_objId);
|
||||
if (uid == kInvalidUniqueId)
|
||||
continue;
|
||||
candidateIds.push_back(uid);
|
||||
}
|
||||
}
|
||||
|
||||
if (candidateIds.empty())
|
||||
return kInvalidUniqueId;
|
||||
|
||||
return candidateIds[mgr.GetActiveRandom()->Range(0, s32(candidateIds.size() - 1))];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user