From 67507c75918f8a60ad218cdcb69cc8d39e4a55ed Mon Sep 17 00:00:00 2001 From: paly2 Date: Sun, 19 Jun 2016 19:12:16 +0200 Subject: Fix move_area not updating AreaStore --- internal.lua | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'internal.lua') diff --git a/internal.lua b/internal.lua index d9ff00d..05a31cd 100644 --- a/internal.lua +++ b/internal.lua @@ -128,6 +128,20 @@ function areas:remove(id, recurse) end end +--- Move an area. +function areas:move(id, area, pos1, pos2) + area.pos1 = pos1 + area.pos2 = pos2 + + if self.store then + self.store:remove_area(areas.store_ids[id]) + local sid = self.store:insert_area(pos1, pos2, tostring(id)) + if self:checkAreaStoreId(sid) then + self.store_ids[id] = sid + end + end +end + -- Checks if a area between two points is entirely contained by another area. -- Positions must be sorted. function areas:isSubarea(pos1, pos2, id) -- cgit v1.2.3