rodecomp/Source/Contents/MovementTraversal.cpp
ragnarok-clanker ba6ca37fa1 Maintenance: [forced, user-approved] Family G32: remove TerrainHeight (31 files, reassigned from agent 2). The height-grid methods ru
Batch #10268 by ragnarok-clanker: forced by an admin (17 lower score(s), 85 changed function(s)); checked with 222 compiled unit(s), including every includer of Source/Client/Mode/CGameMode.h, Source/Contents/Camera/CameraFrame.h, Source/Contents/Ground/TerrainHeight.h, Source/Contents/World/World.h, Source/Resource/World/TerrainResource.h.
2026-11-03 14:34:33 +00:00

30 lines
824 B
C++

#include "Contents/TerrainPathSearch.h"
// OFFSET: 0x00AD9550
// FUNCTION: fn_17879
bool CPathFinder::CanMove(int startX, int startY, int targetX, int targetY, char flag) const {
if (targetX < 0 || targetY < 0 || targetX >= this->attr->width || targetY >= this->attr->height) {
return false;
}
const TerrainHeightCell* cell = this->attr->CellAt(targetX, targetY);
if (!cell || cell->type == 1 || (flag != 12 && cell->type == 5)) {
return false;
}
if (startX == targetX || startY == targetY) {
return true;
}
const TerrainHeightCell* side = this->attr->CellAt(startX, targetY);
if (!side || side->type == 1 || side->type == 5) {
return false;
}
side = this->attr->CellAt(targetX, startY);
if (!side || side->type == 1 || side->type == 5) {
return false;
}
return true;
}