From 26c0ceb1edae8fb699d504aa52050b6fd6c30e31 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Thu, 26 Jun 2014 07:50:16 -0700 Subject: [PATCH] Fix #25 (for real this time) --- moonlight/src/Util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/moonlight/src/Util.js b/moonlight/src/Util.js index 2f609d9..e7fc295 100644 --- a/moonlight/src/Util.js +++ b/moonlight/src/Util.js @@ -289,8 +289,8 @@ function gridWithAISprites() // --- We have to normalize the (x,y) because this may be // called before the sprites are rebounded back inside the map, // and these references will go out of bounds - var normx = Math.min(parseInt(spr.x/32), 0); - var normy = Math.min(parseInt(spr.y/32), 0); + var normx = Math.max(parseInt(spr.x/32), 0); + var normy = Math.max(parseInt(spr.y/32), 0); grid.nodes[normy][normx].walkable = false; } return grid;