Update town.js
This commit is contained in:
7
town.js
7
town.js
@@ -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;
|
||||
}
|
||||
|
||||
// -----------------------------
|
||||
|
||||
Reference in New Issue
Block a user