mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-15 17:25:32 +00:00
parent
e009989ec3
commit
c366998021
@ -29,10 +29,12 @@ function locset_meta:__index(loc)
|
||||
end
|
||||
|
||||
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
|
||||
self:insert(loc.x, loc.y, val)
|
||||
fcn(self, loc.x, loc.y, val)
|
||||
else
|
||||
self:insert(loc[1], loc[2], val)
|
||||
fcn(self, loc[1], loc[2], val)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -36,7 +36,7 @@ function wesnoth.interface.remove_item(x, y, name)
|
||||
end
|
||||
end
|
||||
if not name or #items == 0 then
|
||||
scenario_items:insert(x, y, nil)
|
||||
scenario_items:remove(x, y)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user