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

@@ -95,6 +95,5 @@ des.monster("giant eel", 39, 15)
-- Monsters on siege duty.
local ogrelocs = selection.floodfill(37,7) & selection.area(40,03, 45,20)
for i = 0, 11 do
local x,y = ogrelocs:rndcoord(1);
des.monster({ id = "ogre", coord={x,y}, peaceful=0 })
des.monster({ id = "ogre", coord = ogrelocs:rndcoord(1), peaceful = 0 })
end