rodecomp/Source/Contents/ActorMovementRoute.cpp
ragnarok-clanker 31b89604b0 Decompile 10 functions in Source/Client/Mode/GameModeNotices.cpp, Source/Client/Mode/GameModePackets.cpp, ...
Batch #13148 by KWDev: 10 byte-identical, 0 confirmed by peer review.

- fn_05385 CPetEvolutionMgr::L_InsertEvolutionRecipeLGU: byte-identical
- fn_05440 CRenewQuestMgr::GetMonsterConditionText: byte-identical
- fn_06538 NEO_PACKAGEITEM::CPaidPackageItemMgr::IsPaidItem: byte-identical
- fn_08147 CRuneSystemMgr::Reset: byte-identical
- fn_19316 Replay::AnimationScale: byte-identical
- fn_19317 Replay::DelayScale: byte-identical
- fn_19618 CNavigationManager::FitToSquare: byte-identical
- fn_21737 CGameMode::ReceiveMemorialDungeonNotify: byte-identical
- fn_22067 CGameMode::ReceiveLapineBoxResult: byte-identical
- fn_22123 CGameMode::ReceiveGradeEnchantInfo: byte-identical

Merged automatically: every function is byte-identical to the original.
2026-11-06 07:31:21 +00:00

64 lines
1.6 KiB
C++

#include "Client/Replay.h"
#include "Client/Session.h"
#include "Contents/Actors/GameActor.h"
#include "Contents/TerrainPathSearch.h"
// GLOBAL: gl_24733
CPathFinder g_pathFinder;
// OFFSET: 0x00B84570
// FUNCTION: fn_19317
float Replay::DelayScale() const {
if (0.25f == this->speed) {
return 4.0f;
}
if (0.5f == this->speed) {
return 2.0f;
}
if (1.0f == this->speed) {
return 1.0f;
}
if (2.0f == this->speed) {
return 0.5f;
}
if (4.0f == this->speed) {
return 0.25f;
}
if (8.0f == this->speed) {
return 0.125f;
}
if (16.0f == this->speed) {
return 0.0625f;
}
return 1.0f;
}
// OFFSET: 0x00CAB610
// FUNCTION: fn_21028
bool CGameActor::FindRoute(int startX, int startY, int fractionX, int fractionY, int destX, int destY, int speed) {
float scaledSpeed = 0.0f;
int stepSpeed;
if (g_replayAnimationScaling != 0) {
scaledSpeed = Replay::Instance().DelayScale() * static_cast<float>(speed);
stepSpeed = static_cast<int>(scaledSpeed);
} else {
stepSpeed = speed;
}
const bool found =
g_pathFinder.FindPath(this->routeStartTick, startX, startY, fractionX, fractionY, destX, destY, stepSpeed, this->route, this->unknown_0314);
if (!found) {
return found;
}
std::uint32_t endTick;
this->route.EndTick(&endTick);
const std::uint32_t now = g_session.GetServerTime();
if (endTick > now) {
return found;
}
const int baseSpeed = g_replayAnimationScaling != 0 ? static_cast<int>(scaledSpeed) : speed;
this->routeStartTick = now;
return g_pathFinder.FindPath(now, startX, startY, fractionX, fractionY, destX, destY, baseSpeed * 10 / 13, this->route, this->unknown_0314);
}