From a522c245cffec4b3512e11acfc62ae0e995f7ac0 Mon Sep 17 00:00:00 2001 From: "Clarence \"Sparr\" Risher" Date: Wed, 27 Sep 2017 16:39:32 -0700 Subject: [PATCH] don't randomly spawn bots on bottom/right edge of room --- lib/cli/bots.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/cli/bots.js b/lib/cli/bots.js index a1699bb..43558cb 100644 --- a/lib/cli/bots.js +++ b/lib/cli/bots.js @@ -94,11 +94,11 @@ exports.spawn = utils.withHelp([ .then(() => env.set(env.keys.MEMORY+user._id, "{}")) .then(() => db['rooms.terrain'].findOne({room: roomName})) .then(terrainItem => { - var x = opts.x || Math.floor(3 + Math.random()*46); - var y = opts.y || Math.floor(3 + Math.random()*46); + var x = opts.x || Math.floor(3 + Math.random()*44); + var y = opts.y || Math.floor(3 + Math.random()*44); while(common.checkTerrain(terrainItem.terrain, x, y, C.TERRAIN_MASK_WALL)) { - x = Math.floor(3 + Math.random()*46); - y = Math.floor(3 + Math.random()*46); + x = Math.floor(3 + Math.random()*44); + y = Math.floor(3 + Math.random()*44); } return db['rooms.objects'].insert({ type: 'spawn',