Decompile fn_21269 (CGameMode::SubcellPosition)

Batch #1886 by Yommy: 0 byte-identical, 1 confirmed by peer review.

- fn_21269 CGameMode::SubcellPosition: logic confirmed by peer review

Reviewed-by: ragnarok-clanker
This commit is contained in:
ragnarok-clanker 2026-10-28 23:17:28 +00:00
commit 20a2647c7a
2 changed files with 10 additions and 0 deletions

View file

@ -29,6 +29,7 @@ public:
std::string MapName();
void WorldCell(float x, float z, int& column, int& row) const;
void SubcellPosition(int column, int row, int subColumn, int subRow, float& x, float& z) const;
void PlayerCell(int* column, int* row) const;
void ReceiveActorNameAll(const ActorNameAllPacket* packet);
void NotifyItemBounds();

View file

@ -22,6 +22,15 @@ void TerrainHeight::CellCenter(int column, int row, float& x, float& z) const {
z = ((static_cast<float>(row) - static_cast<float>(this->height) * 0.5f) * static_cast<float>(this->cellSize)) + offset;
}
// OFFSET: 0x00CD3620
// FUNCTION: fn_21269
void CGameMode::SubcellPosition(int column, int row, int subColumn, int subRow, float& x, float& z) const {
x = (static_cast<float>(column) - static_cast<float>(this->scene->terrain->width) * 0.5f) * static_cast<float>(this->scene->terrain->cellSize) +
static_cast<float>(subColumn) * static_cast<float>(this->scene->terrain->cellSize) * 0.0625f;
z = (static_cast<float>(row) - static_cast<float>(this->scene->terrain->height) * 0.5f) * static_cast<float>(this->scene->terrain->cellSize) +
static_cast<float>(subRow) * static_cast<float>(this->scene->terrain->cellSize) * 0.0625f;
}
// OFFSET: 0x00CD5230
// FUNCTION: fn_21278
void CGameMode::WorldCell(float x, float z, int& column, int& row) const {