Lua: coordinate tweaking

Make selection rndcoord return a table with x and y keys.
Allow (most) coordinate parameters accept such a table.
Fix selection and des lua tests broken by the above changes and
an earlier change, because selections tried to set terrain
at column 0, and it now causes a complaint.
This commit is contained in:
Pasi Kallinen
2022-03-22 09:16:15 +02:00
parent 6fb0c8a82e
commit 27898340b9
19 changed files with 240 additions and 173 deletions

View File

@@ -88,8 +88,7 @@ des.monster("abbot", 33, 12)
des.non_diggable(selection.area(18,03,55,16))
-- Random traps
for i = 1, 2 do
local x,y = spacelocs:rndcoord(1);
des.trap("dart",x,y)
des.trap("dart", spacelocs:rndcoord(1))
end
des.trap()
des.trap()
@@ -97,10 +96,8 @@ des.trap()
des.trap()
-- Monsters on siege duty.
for i = 1, 8 do
local x,y = spacelocs:rndcoord(1);
des.monster("earth elemental", x, y)
des.monster("earth elemental", spacelocs:rndcoord(1))
end
for i = 1, 4 do
local x,y = spacelocs:rndcoord(1);
des.monster("xorn", x, y)
des.monster("xorn", spacelocs:rndcoord(1))
end