parent
e009989ec3
commit
c366998021
2 changed files with 5 additions and 3 deletions
|
@ -29,10 +29,12 @@ function locset_meta:__index(loc)
|
||||||
end
|
end
|
||||||
|
|
||||||
function locset_meta:__newindex(loc, val)
|
function locset_meta:__newindex(loc, val)
|
||||||
|
local fcn = methods.insert
|
||||||
|
if val == nil then fcn = methods.remove end
|
||||||
if loc.x and loc.y then
|
if loc.x and loc.y then
|
||||||
self:insert(loc.x, loc.y, val)
|
fcn(self, loc.x, loc.y, val)
|
||||||
else
|
else
|
||||||
self:insert(loc[1], loc[2], val)
|
fcn(self, loc[1], loc[2], val)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ function wesnoth.interface.remove_item(x, y, name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if not name or #items == 0 then
|
if not name or #items == 0 then
|
||||||
scenario_items:insert(x, y, nil)
|
scenario_items:remove(x, y)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue