Decompile fn_19573 (CNavigationManager::RouteFromPlayer)

Batch #18073 by eAthena: 0 byte-identical, 1 confirmed by peer review.

- fn_19573 CNavigationManager::RouteFromPlayer: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, Yommy, alisonrag, cremane
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-12 14:25:15 +00:00
commit 71c234dba3

View file

@ -14,6 +14,7 @@
template __declspec(noinline) bool std::_Traits_equal<std::char_traits<char>>(const char*, std::size_t, const char*, std::size_t) noexcept;
template __declspec(noinline) std::vector<char>::vector(const std::size_t, const char&, const std::allocator<char>&);
template __declspec(noinline) void std::vector<PathCell>::push_back(const PathCell&);
// GLOBAL: gl_24627
CNavigationManager g_navigationManager;
@ -654,7 +655,7 @@ int CNavigationManager::RouteFromPlayer() {
if (this->data.GetInfo() == info) {
const int type = this->savedTarget.type;
if (type != 2 && type != 0) {
int code = type == 1 ? 6 : -96;
int code = type != 1 ? -96 : 6;
if (type == 3) {
code = 8;
}
@ -679,7 +680,7 @@ int CNavigationManager::RouteFromPlayer() {
this->currentTarget = this->savedTarget;
this->LoadTargetPreview();
const int targetType = this->savedTarget.type;
result = targetType == 2 ? 7 : -96;
result = targetType != 2 ? -96 : 7;
this->drawRoute = true;
this->routeFlag = true;
this->drawDestination = true;
@ -733,8 +734,7 @@ int CNavigationManager::RouteFromPlayer() {
NaviCell cellX;
NaviCell cellY;
if (start.x == this->nodes[0]->GetCell(&cellX)->x && start.y == this->nodes[0]->GetCell(&cellY)->y) {
PathCell point = {start.x, start.y, 0, 0};
this->movementRoute.points.push_back(point);
this->movementRoute.points.push_back({start.x, start.y, 0, 0});
} else if (!this->BuildRoute(start.x, start.y, this->nodes[0]->GetCell(&cellX)->x, this->nodes[0]->GetCell(&cellY)->y, true)) {
goto search;
}