rodecomp/Source/Contents/NavigationCandidates.cpp
ragnarok-clanker 14a432d922 Maintenance: [forced, user-approved] Family F3: remove WindowDialogs, WindowResponseRecorder, UIMessageBoxContext, UIEntryQueueContex
Batch #10232 by ragnarok-clanker: forced by an admin (22 lower score(s), 263 changed function(s)); checked with 562 compiled unit(s), including every includer of Source/Client/Mode/CLoginMode.h, Source/Client/ReplayPacketRecorder.h, Source/Client/Session.h, Source/Contents/NavigationManager.h, Source/UI/Acceptance/UIJoinPartyAcceptWnd.h, Source/UI/EntryQueue/UIEntryQueueWnd.h, Source/UI/Guild/UIAgitWnd.h, Source/UI/Item/UIParaItemShopWnd.h, Source/UI/Items/UIItemRepairWnd.h, Source/UI/Items/UIMakeTargetListWnd.h, Source/UI/Items/UIMakeTargetProcessWnd.h, Source/UI/Items/UIWeaponRefineWnd.h, Source/UI/Window/UIHomunInfoWnd.h, Source/UI/Window/UIMerInfoWnd.h, Source/UI/Window/UIMessageBox.h, Source/UI/Window/UINavigationWnd.h, Source/UI/Window/UIPayConfirmWnd.h, Source/UI/Window/UIPetInfoWnd.h, Source/UI/Window/UIShowWarpWnd.h, Source/UI/Window/UIWindow.h, Source/UI/Window/UIWindowMgr.h, Source/UI/Window/WindowDialogs.h.
2026-11-03 10:23:36 +00:00

58 lines
1.8 KiB
C++

#include "Contents/NavigationManager.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Mode/ModeMgr.h"
#include "Client/Session.h"
#include "Contents/MessageTable.h"
#include "Resource/ResourceMgr.h"
#include "UI/Window/UIWindowMgr.h"
#include "UI/Window/WindowDialogs.h"
#include <string>
#include <vector>
// OFFSET: 0x00BA0870
// FUNCTION: fn_19634
bool CNavigationManager::CollectStartLinks() {
CNaviInfo* info = this->FindObject(g_session.m_navigationPlayerMap);
if (info == nullptr) {
const std::string resolved = ResourceMgr::Instance().aliases.ResolveMapName(g_session.m_navigationPlayerMap);
info = this->FindObject(resolved.c_str());
if (info == nullptr) {
g_windowMgr.Confirm(LookupMessage(2293), 0, true, false, 0, "Message", 280, 120, 0);
return false;
}
}
if (info->LinkCount() == 0) {
return false;
}
CGameMode* mode = static_cast<CGameMode*>(g_modeMgr.GetGameMode());
if (mode == nullptr) {
return false;
}
int column;
int row;
mode->PlayerCell(&column, &row);
this->UpdateGround();
MovementRouteInterpolation route;
this->data.startLinks.clear();
for (std::vector<CNavi_Link*>::iterator it = info->LinksBegin(); it != info->LinksEnd(); ++it) {
NaviCell linkCell;
NaviCell linkRowCell;
if ((*it)->GetCell(&linkCell)->x == column && (*it)->GetCell(&linkRowCell)->y == row) {
this->data.startLinks.push_back(NaviLink{*it, 1});
} else {
NaviCell targetRowCell;
NaviCell targetCell;
if (this->pathFinder.FindPath(1, column, row, 8, 8, (*it)->GetCell(&targetCell)->x, (*it)->GetCell(&targetRowCell)->y, 10, route, 15)) {
this->data.startLinks.push_back(NaviLink{*it, static_cast<int>(route.points.size())});
}
this->pathFinder.Reset();
}
}
return !this->data.startLinks.empty();
}