diff --git a/public/admin/plan.html b/public/admin/plan.html
index c8c12ca..fa02e37 100644
--- a/public/admin/plan.html
+++ b/public/admin/plan.html
@@ -57,7 +57,7 @@ document.getElementById('controls').innerHTML = `
// ---------- geometry ----------
function extent() {
- let minX = 0, minZ = 0, maxX = 100, maxZ = 100;
+ let minX = Infinity, minZ = Infinity, maxX = -Infinity, maxZ = -Infinity;
const eat = (x, z, pad = 10) => {
minX = Math.min(minX, x - pad); maxX = Math.max(maxX, x + pad);
minZ = Math.min(minZ, z - pad); maxZ = Math.max(maxZ, z + pad);
@@ -68,6 +68,8 @@ function extent() {
for (const b of scene.buildings || []) eat(b.position[0], b.position[2], Math.max(b.size[0], b.size[2]) / 2 + 5);
for (const s of scene.spawns || []) eat(s.position[0], s.position[2]);
for (const p of scene.paths || []) for (const q of p.points || []) eat(q[0], q[2]);
+ // nothing to draw → fall back to a small default page area
+ if (!isFinite(minX)) { minX = 0; minZ = 0; maxX = 100; maxZ = 100; }
return { minX, minZ, maxX, maxZ, w: maxX - minX, h: maxZ - minZ };
}