maze bugfix: correct stalling when 0 is picked (Lua starts things at 1 - ewwwww......)

This commit is contained in:
Starbeamrainbowlabs 2020-04-29 01:03:51 +01:00
parent b235562ab5
commit c83cc9bf39
Signed by: sbrl
GPG key ID: 1BE5172E637709C2

View file

@ -58,7 +58,7 @@ function generate_maze(seed, width, height)
if #directions > 0 then
-- we still have somewhere that we can go
--print("This node is not a dead end yet.")
local curdirnum = math.random(0, #directions)
local curdirnum = math.random(1, #directions)
local curdir = string.sub(directions, curdirnum, curdirnum)
if curdir == "u" then
world[cy - 1][cx] = " "