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:
@@ -98,13 +98,13 @@ des.door("closed",17,12)
|
||||
des.door("closed",17,14)
|
||||
des.region({ region={18,09, 22,15}, lit = 1, type = "zoo", filled = 1, irregular = 1 });
|
||||
|
||||
px, py = selection.rndcoord(place);
|
||||
local pt = selection.rndcoord(place);
|
||||
if percent(25) then
|
||||
des.object({ id="bag of holding", x=px, y=py,
|
||||
des.object({ id="bag of holding", coord=pt,
|
||||
buc="not-cursed", achievement=1 });
|
||||
else
|
||||
des.object({ id="amulet of reflection", x=px, y=py,
|
||||
des.object({ id="amulet of reflection", coord=pt,
|
||||
buc="not-cursed", achievement=1 });
|
||||
end
|
||||
des.engraving({ x = px, y = py, type = "burn", text = "Elbereth" });
|
||||
des.object({ id = "scare monster", x = px, y = py, buc = "cursed" });
|
||||
des.engraving({ coord = pt, type = "burn", text = "Elbereth" });
|
||||
des.object({ id = "scare monster", coord = pt, buc = "cursed" });
|
||||
|
||||
Reference in New Issue
Block a user