diff --git a/Source/Client/Mode/CGameMode.h b/Source/Client/Mode/CGameMode.h index c806159..c3bfca4 100644 --- a/Source/Client/Mode/CGameMode.h +++ b/Source/Client/Mode/CGameMode.h @@ -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(); diff --git a/Source/Contents/Ground/TerrainCoordinates.cpp b/Source/Contents/Ground/TerrainCoordinates.cpp index f17c3c8..7218d45 100644 --- a/Source/Contents/Ground/TerrainCoordinates.cpp +++ b/Source/Contents/Ground/TerrainCoordinates.cpp @@ -22,6 +22,15 @@ void TerrainHeight::CellCenter(int column, int row, float& x, float& z) const { z = ((static_cast(row) - static_cast(this->height) * 0.5f) * static_cast(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(column) - static_cast(this->scene->terrain->width) * 0.5f) * static_cast(this->scene->terrain->cellSize) + + static_cast(subColumn) * static_cast(this->scene->terrain->cellSize) * 0.0625f; + z = (static_cast(row) - static_cast(this->scene->terrain->height) * 0.5f) * static_cast(this->scene->terrain->cellSize) + + static_cast(subRow) * static_cast(this->scene->terrain->cellSize) * 0.0625f; +} + // OFFSET: 0x00CD5230 // FUNCTION: fn_21278 void CGameMode::WorldCell(float x, float z, int& column, int& row) const {