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:19 +02:00
parent 6fb0c8a82e
commit 27898340b9
19 changed files with 240 additions and 173 deletions
+3 -4
View File
@@ -49,8 +49,8 @@ des.teleport_region({ region = {64,01,74,17}, dir="down" });
des.teleport_region({ region = {02,02,18,13}, dir="up" });
--
des.levregion({ region = {67,01,74,20}, type="stair-up" });
local mx, my = place:rndcoord(1);
des.stair("down", mx, my)
des.stair("down", place:rndcoord(1))
--
des.door("locked",04,06)
des.door("locked",04,10)
@@ -66,8 +66,7 @@ des.non_diggable(selection.area(01,01,22,14));
--
des.object("crystal ball", 07,08)
--
local px, py = place:rndcoord(1);
des.object({ id="statue",x=px, y=py, buc="uncursed",
des.object({ id="statue",coord=place:rndcoord(1), buc="uncursed",
montype="knight", historic=1, male=1,name="Perseus",
contents = function()
if percent(75) then