Move _generateTrees() to after npcWorldX is set so trees span the full path

This commit is contained in:
justin committed 2026-05-20 21:05:45 -07:00
1 parent 450eccc89e
commit ef374b0378
1 file changed
+2 -1
+2 -1
View File
@@ -1031,7 +1031,6 @@ class Game {
/* We need the viewport size — defer a tick so the DOM is laid out */
requestAnimationFrame(() => {
this._generateTrees();
const world = document.getElementById('map-inner');
const viewW = world ? world.parentElement.offsetWidth : 420;
@@ -1049,6 +1048,8 @@ class Game {
this.state.npcWorldY = 0;
}
this._generateTrees();
document.getElementById('hud-name').textContent = this.state.playerName||'ASH';
this.updateHUD();