From 277d304313066355129f3953ac0ed26910d8c479 Mon Sep 17 00:00:00 2001 From: Dignissi <34785776+Dignissi@users.noreply.github.com> Date: Sun, 1 Dec 2019 22:41:26 -0500 Subject: [PATCH] Allow user to extend the Array prototype As-is, modifications to the array prototype will break the ability to create construction sites near the edges of rooms, where it would otherwise be allowed. --- src/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils.js b/src/utils.js index 841ae2ee..13989cad 100644 --- a/src/utils.js +++ b/src/utils.js @@ -146,8 +146,8 @@ exports.checkConstructionSite = function(objects, structureType, x, y) { if(_.isString(objects) || objects instanceof Uint8Array) { if(borderTiles) { - for(var i in borderTiles) { - if(!exports.checkTerrain(objects, borderTiles[i][0], borderTiles[i][1], C.TERRAIN_MASK_WALL)) { + for(var t of borderTiles) { + if(!exports.checkTerrain(objects, t[0], t[1], C.TERRAIN_MASK_WALL)) { return false; } }