[b25] ]] in Lua, is it bug or not?

Moderator: Moderator

Post Reply
Message
Author
sindikat
Low Yeek
Posts: 8
Joined: Fri Apr 01, 2011 2:10 pm

[b25] ]] in Lua, is it bug or not?

#1 Post by sindikat »

Let's say i've created a static map like that
map = [[
~~~
~~~
~~~]]

everything works fine. But when i create a map like that

map = [[
~~~
~~~
~~~
]]

try to go to the south and you will have an error thrown, like the hero went past the lower border. Is it Lua specific syntax thing or a bug? If former, then it should be noted somewhere in a guide, i think.

P.S.: admin, do you plan to create a bug-tracker?

Grey
Loremaster
Posts: 3517
Joined: Thu Sep 23, 2010 10:18 pm
Location: London, England
Contact:

Re: [b25] ]] in Lua, is it bug or not?

#2 Post by Grey »

Well I wouldn't call it a bug - the brackets act as quotations, so you're adding in an extra line in the second example. It's annoying when you forget of course, but rather to be expected. Still, I imagine a fix is possible (check for nil values on last line of array).
http://www.gamesofgrey.com - My own T-Engine games!
Roguelike Radio - A podcast about roguelikes

Post Reply