From e2e0c0ae995789a1cfc3bbad4ff551db8307f1f8 Mon Sep 17 00:00:00 2001 From: zkl2333 Date: Sun, 27 Oct 2019 00:41:13 +0800 Subject: [PATCH 1/2] fix: Replace deprecated methods --- src/creep-tasks/prototypes.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/creep-tasks/prototypes.ts b/src/creep-tasks/prototypes.ts index b12592e..dbe8cee 100644 --- a/src/creep-tasks/prototypes.ts +++ b/src/creep-tasks/prototypes.ts @@ -104,7 +104,7 @@ Object.defineProperty(RoomPosition.prototype, 'neighbors', { RoomPosition.prototype.isPassible = function (ignoreCreeps = false): boolean { // Is terrain passable? - if (Game.map.getTerrainAt(this) == 'wall') return false; + if (Game.map.getRoomTerrain(this.roomName).get(this.x, this.y) == TERRAIN_MASK_WALL) { if (this.isVisible) { // Are there creeps? if (ignoreCreeps == false && this.lookFor(LOOK_CREEPS).length > 0) return false; From 6bad8453a8e485d2155265c034244df746cc2fbe Mon Sep 17 00:00:00 2001 From: zkl2333 Date: Sun, 27 Oct 2019 01:25:02 +0800 Subject: [PATCH 2/2] fix: Stupid bug --- src/creep-tasks/prototypes.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/creep-tasks/prototypes.ts b/src/creep-tasks/prototypes.ts index dbe8cee..59e2242 100644 --- a/src/creep-tasks/prototypes.ts +++ b/src/creep-tasks/prototypes.ts @@ -105,6 +105,8 @@ Object.defineProperty(RoomPosition.prototype, 'neighbors', { RoomPosition.prototype.isPassible = function (ignoreCreeps = false): boolean { // Is terrain passable? if (Game.map.getRoomTerrain(this.roomName).get(this.x, this.y) == TERRAIN_MASK_WALL) { + return false; + } if (this.isVisible) { // Are there creeps? if (ignoreCreeps == false && this.lookFor(LOOK_CREEPS).length > 0) return false;