mirror of
https://github.com/zeldaret/botw
synced 2026-10-11 06:11:55 -04:00
98f0c80f1d
They link in the same block as the plain-ksys:: Message family. getItemValue and applyScreenFade sit in engine UI TUs, hence ksys::ui. (AI assisted using Claude Fable 5.1 and Claude Opus 5.5)
46 lines
1.3 KiB
C++
46 lines
1.3 KiB
C++
#include "KingSystem/ActorSystem/actBaseProcCreateTaskSelector.h"
|
|
#include <limits>
|
|
#include "KingSystem/ActorSystem/actBaseProcCreateTask.h"
|
|
#include "KingSystem/Map/mapObject.h"
|
|
|
|
namespace ksys::act {
|
|
|
|
SEAD_SINGLETON_DISPOSER_IMPL(BaseProcCreateTaskSelector)
|
|
|
|
Task* BaseProcCreateTaskSelector::selectTask(const TaskSelectionContext& context) {
|
|
Task* min_task = nullptr;
|
|
Task* lane1_task = nullptr;
|
|
auto min = std::numeric_limits<float>::max();
|
|
|
|
for (auto& it : context) {
|
|
auto* task = sead::DynamicCast<BaseProcCreateTask>(&it);
|
|
if (!task)
|
|
return ⁢
|
|
|
|
if (task->getLaneId() == u8(BaseProcCreateTask::LaneId::_2))
|
|
return ⁢
|
|
|
|
if (task->mMapObject && task->mMapObject->getFlags0().isOff(map::Object::Flag0::_4))
|
|
return ⁢
|
|
|
|
if (task->mDistanceToLoadSphere >= 0.0 && min > task->mDistanceToLoadSphere)
|
|
min_task = ⁢
|
|
|
|
if (task->mDistanceToLoadSphere >= 0.0 && min > task->mDistanceToLoadSphere)
|
|
min = task->mDistanceToLoadSphere;
|
|
|
|
if (task->getLaneId() == u8(BaseProcCreateTask::LaneId::_1))
|
|
lane1_task = ⁢
|
|
}
|
|
|
|
if (min_task)
|
|
return min_task;
|
|
|
|
if (lane1_task)
|
|
return lane1_task;
|
|
|
|
return std::addressof(*context.begin());
|
|
}
|
|
|
|
} // namespace ksys::act
|