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

@@ -140,8 +140,7 @@ des.object(object[4],53,11)
des.object(object[4],54,11)
des.object(object[4],55,11)
-- THE WAND OF WISHING in 1 of the 4 towers
local px, py = place:rndcoord(1);
des.object({ id = "chest", trapped = 0, locked = 1, x = px, y = py,
des.object({ id = "chest", trapped = 0, locked = 1, coord = place:rndcoord(1),
contents = function()
des.object("wishing");
end