There's a really strange bug. When I use assert to check if the CH variable returns the total number of roomlist,
it works. But on the next line (when I remove assert), it mentions the following error:
bad argument #1 to 'random' (interval is empty) ???
What should I understand?
function rnd_room()
local choix
ch=#roomlist
debug=false assert(debug,ch)
choix=math.random(1,ch)
x=roomlist[choix].x
y=roomlist[choix].y
table.remove(rooml,choix)
return x,y
end



It isn't actually working, the assert gives an error. It's not unknown for errors to be hidden, though.
[Please log in to post a comment]