From efd0a6de29ef2bdf8fc440eb507610585da33f88 Mon Sep 17 00:00:00 2001 From: Kelsi Date: Wed, 6 May 2026 07:34:58 -0700 Subject: [PATCH] fix(editor): reject out-of-range tile coords in loadADT A tileX/tileY outside 0..63 would generate ADT paths the asset manager refuses, then poison the manifest.tiles entries on save. Reject upfront with a log message. --- tools/editor/editor_app.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/editor/editor_app.cpp b/tools/editor/editor_app.cpp index 880270fc..443ff925 100644 --- a/tools/editor/editor_app.cpp +++ b/tools/editor/editor_app.cpp @@ -855,6 +855,14 @@ bool EditorApp::loadWMOInstance(const std::string& mapName) { } void EditorApp::loadADT(const std::string& mapName, int tileX, int tileY) { + // WoW tile grid is 64x64 — out-of-range coords would compute paths + // like "World\Maps\Foo\Foo_-1_-1.adt" that the asset manager refuses, + // and would also poison the manifest.tiles entries on save. + if (tileX < 0 || tileX > 63 || tileY < 0 || tileY > 63) { + LOG_ERROR("loadADT rejected: tile (", tileX, ",", tileY, + ") out of valid 0..63 range"); + return; + } // Clear previous state before loading new tile clearAllObjects(); questEditor_.clear();