parent
831655fd57
commit
1f32466782
1 changed files with 11 additions and 4 deletions
|
@ -86,18 +86,25 @@ end
|
|||
|
||||
function methods:get(...)
|
||||
local loc = wesnoth.map.read_location(...)
|
||||
return self.values[index(loc.x, loc.y)]
|
||||
if loc ~= nil then
|
||||
return self.values[index(loc.x, loc.y)]
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function methods:insert(...)
|
||||
local loc, n = wesnoth.map.read_location(...)
|
||||
local v = select(n + 1, ...)
|
||||
self.values[index(loc.x, loc.y)] = v or true
|
||||
if loc ~= nil then
|
||||
local v = select(n + 1, ...)
|
||||
self.values[index(loc.x, loc.y)] = v or true
|
||||
end
|
||||
end
|
||||
|
||||
function methods:remove(...)
|
||||
local loc = wesnoth.map.read_location(...)
|
||||
self.values[index(loc.x, loc.y)] = nil
|
||||
if loc ~= nil then
|
||||
self.values[index(loc.x, loc.y)] = nil
|
||||
end
|
||||
end
|
||||
|
||||
function methods:clone()
|
||||
|
|
Loading…
Add table
Reference in a new issue