rodecomp/Source/Contents/Movement/MovementRouteInterpolation.h
ragnarok-clanker a39257b59e Decompile 2 functions in Source/Contents/Movement/MovementRoute.cpp, Source/Contents/Movement/TerrainPathSearch.cpp, ...
Batch #18222 by eAthena: 0 byte-identical, 2 confirmed by peer review.

- fn_17867 CPathFinder::BuildMovementRoute: logic confirmed by peer review
- fn_17868 CPathFinder::FindPath: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, alisonrag, Toshiro, cremane
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-11-12 14:25:37 +00:00

53 lines
1.6 KiB
C++

#ifndef RAGNAROK_SOURCE_CONTENTS_MOVEMENT_MOVEMENTROUTEINTERPOLATION_H
#define RAGNAROK_SOURCE_CONTENTS_MOVEMENT_MOVEMENTROUTEINTERPOLATION_H
#include <cstddef>
#include <cstdint>
#include <vector>
struct PathNode {
/* 0000 */ std::int32_t x;
/* 0004 */ std::int32_t y;
/* 0008 */ PathNode* parent;
/* 000C */ int cost;
/* 0010 */ int estimatedCost;
/* 0014 */ int state;
/* 0018 */ int metadata;
};
struct PathCell {
/* 0000 */ std::int32_t x;
/* 0004 */ std::int32_t y;
/* 0008 */ int metadata;
/* 000C */ std::uint32_t tick;
};
struct MovementRouteInterpolation {
MovementRouteInterpolation();
/* 0000 */ std::vector<PathCell> points;
/* 000C */ std::uint32_t segment;
/* 0010 */ float startX;
/* 0014 */ float startY;
bool Point(int index, std::int32_t* x, std::int32_t* y) const;
std::uint32_t* EndTick(std::uint32_t* tick) const;
int EndMetadata() const;
int NextPoint(std::uint32_t tick, std::uint32_t* nextTick, float* x, float* y) const;
int Sample(std::uint32_t tick, float* x, float* y, int* metadata);
std::uint32_t Segment() const;
std::uint32_t Duration() const;
bool Empty() const;
};
static_assert(sizeof(PathCell) == 16);
#if defined(_WIN32) && !defined(_WIN64)
static_assert(sizeof(PathNode) == 28);
static_assert(offsetof(PathNode, metadata) == 0x18);
static_assert(sizeof(MovementRouteInterpolation) == 24);
static_assert(offsetof(MovementRouteInterpolation, segment) == 0xC);
static_assert(offsetof(MovementRouteInterpolation, startX) == 0x10);
static_assert(offsetof(MovementRouteInterpolation, startY) == 0x14);
#endif
#endif