mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-06 09:03:52 +00:00
fix(editor): override ADT internal coords with filename coords on load
Root cause of ADT loading failures: instanced maps (dungeons, raids) have arbitrary internal coord values (e.g. tile 62,0 for a file named _28_27.adt). The terrain mesh generator uses these coords to compute world positions, resulting in chunks placed thousands of units away from the camera → "Failed to upload terrain to GPU". Fix: override terrain_.coord with the tileX/tileY from the filename before mesh generation. This ensures chunks are positioned correctly regardless of what the ADT file's internal header says.
This commit is contained in:
parent
79db38219f
commit
9c0bc5fbd1
1 changed files with 4 additions and 0 deletions
|
|
@ -552,6 +552,10 @@ void EditorApp::loadADT(const std::string& mapName, int tileX, int tileY) {
|
|||
return;
|
||||
}
|
||||
|
||||
// Override internal coords with what we know from the filename
|
||||
// (instanced maps have arbitrary internal coord values)
|
||||
terrain_.coord = {tileX, tileY};
|
||||
|
||||
terrainEditor_.setTerrain(&terrain_);
|
||||
terrainEditor_.history().clear();
|
||||
texturePainter_.setTerrain(&terrain_);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue