Permalink
Browse files

Empty tables are never nil

  • Loading branch information...
mugmuggy committed Nov 24, 2017
1 parent 8e146b3 commit c794f7c9f7f1cfbc1ecb912f34fc93755b270060
Showing with 2 additions and 2 deletions.
  1. +2 −2 CorsixTH/Lua/entity_map.lua
@@ -186,8 +186,8 @@ function EntityMap:getAdjacentFreeTiles(x, y)
local x_coord = coord['x']
local y_coord = coord['y']
-- If no object or humanoid occupy the til_coorde
if self:getHumanoidsAtCoordinate(x_coord, y_coord) == nil and
self:getObjectsAtCoordinate(x_coord, y_coord) == nil then
if #self:getHumanoidsAtCoordinate(x_coord, y_coord) == 0 and
#self:getObjectsAtCoordinate(x_coord, y_coord) == 0 then
adjacent_free_tiles[#adjacent_free_tiles+1] = coord
end
end

0 comments on commit c794f7c

Please sign in to comment.