Executing room failed: W12N25 Error
Wendel-Huang opened this issue · 5 comments
Executing room failed: W12N25 Error: Invalid arguments in RoomPosition constructor Error: Invalid arguments in RoomPosition constructor
at new RoomPosition (:14861:19)
at RoomPosition.getAllPositionsInRange (prototype_roomPosition:90:13)
at RoomPosition.getAllPositionsInRange.next ()
at Object.Room.getCostMatrix (prototype_room_costmatrix:135:20)
at Object.Room.updatePosition (prototype_room_init:161:31)
at Object.Room.setup (prototype_room_init:611:8)
at Object.Room.myHandleRoom (prototype_room_my:26:10)
at Object.Room.handle (prototype_room:16:17)
at Object.Room.execute (prototype_room:24:29)
at brain.main.roomFilter (config_brain_main:21:7)
Refering to screeps/engine#87 RoomPosition cannot be instanciated with improper values.
This can be fixed by testing coordinates to avoid < 0 and >= 50 :
prototype_roomPosition.js:
RoomPosition.prototype.getAllPositionsInRange = function* (range) {
for (let x = -range; x <= range; ++x) {
for (let y = -range; y <= range; ++y) {
if (this.x + x >= 0 && this.y +y >= 0 && this.x + x < 50 && this.y +y < 50) {
yield new RoomPosition(this.x + x, this.y + y, this.roomName);
}
}
}
};
thank you very much!
but it seems that there is new problems:
8217803 E13S12 Executing room failed: E13S12 Error: Invalid arguments in RoomPosition constructor Error: Invalid arguments in RoomPosition constructor
at new RoomPosition (:14861:19)
at checkForSurroundingWalls (prototype_room_init:423:18)
at sorter (prototype_room_init:449:14)
at :23394:30
at :18556:27
at :19330:15
at baseMap (:18555:7)
at Function.sortBy (:23393:20)
at Object.Room.setup (prototype_room_init:473:24)
at Object.Room.buildBase (prototype_room_controller:79:10)
[下午7:56:31][shard3]8217804 E13S12 costmatrix.setup called
[下午7:56:31][shard3]8217804 E13S12 Testing fillerPosnull
[下午7:56:31][shard3]8217804 E13S12 Executing room failed: E13S12 TypeError: fillerPos.findNearPosition is not a function TypeError: fillerPos.findNearPosition is not a function
at Object.Room.setFillerArea (prototype_room_init:83:42)
at Object.Room.updatePosition (prototype_room_init:158:10)
at Object.Room.setup (prototype_room_init:459:8)
at Object.Room.buildBase (prototype_room_controller:79:10)
at Object.Room.executeRoom (prototype_room_my:289:8)
at Object.Room.myHandleRoom (prototype_room_my:35:15)
at Object.Room.handle (prototype_room:9:10)
at Object.Room.execute (prototype_room:19:27)
at Memory.myRooms._.filter.r (main:44:48)
at :18213:13
[下午7:56:34][shard3]8217805 E13S12 costmatrix.setup called
[下午7:56:34][shard3]8217805 E13S12 Testing fillerPos{"x":29,"y":4,"roomName":"E13S12"}
[下午7:56:34][shard3]
Apply the same fix in prototype_room_init:423. Hey, it's a coding program, you'll have to code at some point and not just copy/paste solutions :) There is no fun in that.
Thank you for reporting this, I fully agree to @odoucet - This code base is community driven, so I would suggest to look into it, try to solve it and send a Pull Request :-)
I could fix certain cases, when the Pull Requests gets merged the issue should be fixed