mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 01:50:24 +00:00
Fixed location_set().of_pairs() syntax to follow conventions.
This commit is contained in:
parent
04f7993ed5
commit
4e6ecc81ce
@ -109,29 +109,25 @@ function methods:of_pairs(t)
|
||||
|
||||
for i,v in ipairs(t) do
|
||||
local value_table = {}
|
||||
if (v.x) and (v.y) then
|
||||
for k,val in pairs(v) do
|
||||
if (k ~= "x") and (k ~= "y") then
|
||||
value_table[k] = val
|
||||
end
|
||||
end
|
||||
if (next(value_table) ~= nil) then
|
||||
values[index(v.x, v.y)] = value_table
|
||||
else
|
||||
values[index(v.x, v.y)] = true
|
||||
end
|
||||
local x_index
|
||||
local y_index
|
||||
if v.x and v.y then
|
||||
x_index = "x"
|
||||
y_index = "y"
|
||||
else
|
||||
for k,val in pairs(v) do
|
||||
if (k ~= 1) and (k ~= 2) then
|
||||
value_table[k] = val
|
||||
end
|
||||
end
|
||||
if (next(value_table) ~= nil) then
|
||||
values[index(v[1], v[2])] = value_table
|
||||
else
|
||||
values[index(v[1], v[2])] = true
|
||||
x_index = 1
|
||||
y_index = 2
|
||||
end
|
||||
for k,val in pairs(v) do
|
||||
if k ~= x_index and k ~= y_index then
|
||||
value_table[k] = val
|
||||
end
|
||||
end
|
||||
if next(value_table) then
|
||||
values[index(v[x_index], v[y_index])] = value_table
|
||||
else
|
||||
values[index(v[x_index], v[y_index])] = true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user