From c9715c96517020ca44b8b77192479b6fae6dac5d Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sat, 4 Sep 2010 20:00:46 +0000 Subject: [PATCH] plop git-svn-id: http://svn.net-core.org/repos/t-engine4@1142 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engines/default/engine/Map.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/game/engines/default/engine/Map.lua b/game/engines/default/engine/Map.lua index 76eab03ba2..1dff112907 100644 --- a/game/engines/default/engine/Map.lua +++ b/game/engines/default/engine/Map.lua @@ -589,13 +589,16 @@ end -- @param x position -- @param y position -- @param what property to check +-- @return a table containing all return values, indexed by the entities function _M:checkAllEntitiesNoStop(x, y, what, ...) - if x < 0 or x >= self.w or y < 0 or y >= self.h then return end + if x < 0 or x >= self.w or y < 0 or y >= self.h then return {} end + local ret = {} if self.map[x + y * self.w] then for _, e in pairs(self.map[x + y * self.w]) do - e:check(what, x, y, ...) + ret[e] = e:check(what, x, y, ...) end end + return ret end --- Check specified entity position of the grid for a property -- GitLab