Update town.js
This commit is contained in:
7
town.js
7
town.js
@@ -54,9 +54,10 @@
|
|||||||
// Compute Sea from x,y
|
// Compute Sea from x,y
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
function computeSea(x, y) {
|
function computeSea(x, y) {
|
||||||
const seaY = Math.floor(y / 100);
|
if (typeof x !== 'number' || typeof y !== 'number') return null;
|
||||||
const seaX = Math.floor(x / 100);
|
const sx = Math.floor(x / 100); // col (0-based)
|
||||||
return seaY * 10 + seaX;
|
const sy = Math.floor(y / 100); // row (0-based)
|
||||||
|
return sx * 10 + sy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------------------
|
// -----------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user