--[[
This function checks if a tile has no entity on it and (optionally) if it is not
in a room.
!param x (integer) the queried tile's x coordinate.
!param y (integer) the queried tile's y coordinate.
!param not_in_room (boolean) If set, also check the tile is not in a room.
!return (boolean) whether all checks hold.
--]]
function World:isTileEmpty(x, y, not_in_room)
for _, entity in ipairs(self.entities) do
if entity.tile_x == x and entity.tile_y == y then
return false
end
end
if not_in_room then
return self:getRoom(x, y) == nil
end
return true
end