From fcc4138e0444ada0cee8c81861ec01eeda4b65fb Mon Sep 17 00:00:00 2001 From: Shauren Date: Mon, 9 Mar 2026 22:22:41 +0100 Subject: [PATCH] Tools/Misc: Document strange array access indexing --- src/tools/map_extractor/System.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tools/map_extractor/System.cpp b/src/tools/map_extractor/System.cpp index 4b5bbdfcee..9e02a67251 100644 --- a/src/tools/map_extractor/System.cpp +++ b/src/tools/map_extractor/System.cpp @@ -511,6 +511,7 @@ bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int // Set map height as grid height for (int y = 0; y <= ADT_CELL_SIZE; y++) { + // edge V9s are overlapping between cells (i * ADT_CELL_SIZE is correct, otherwise we would be missing a row/column of V8s between) int cy = mcnk->iy * ADT_CELL_SIZE + y; for (int x = 0; x <= ADT_CELL_SIZE; x++) { @@ -536,6 +537,7 @@ bool ConvertADT(std::string const& inputPath, std::string const& outputPath, int // get V9 height map for (int y = 0; y <= ADT_CELL_SIZE; y++) { + // edge V9s are overlapping between cells (i * ADT_CELL_SIZE is correct, otherwise we would be missing a row/column of V8s between) int cy = mcnk->iy * ADT_CELL_SIZE + y; for (int x = 0; x <= ADT_CELL_SIZE; x++) {