Update town.js

This commit is contained in:
2025-08-17 20:23:14 +00:00
parent 87b0675e6d
commit 875dcbb926

View File

@@ -54,9 +54,10 @@
// Compute Sea from x,y
// -----------------------------
function computeSea(x, y) {
const seaY = Math.floor(y / 100);
const seaX = Math.floor(x / 100);
return seaY * 10 + seaX;
if (typeof x !== 'number' || typeof y !== 'number') return null;
const sx = Math.floor(x / 100); // col (0-based)
const sy = Math.floor(y / 100); // row (0-based)
return sx * 10 + sy;
}
// -----------------------------