Page 1 of 1

Argument Error (Solved)

Posted: Fri Dec 27, 2013 1:01 am
by XCaptain
I have found a big bug in love 0.9.0 involving functions that use (...). The function line.midpoint(...) takes an undefined number of arguments, which love 0.9.0 will always pass the file directory instead of the given values. The fallowing .love file will work in 0.8.0 but will not work in 0.9.0.
Line.love
Broken in love 0.8.0
(1.44 KiB) Downloaded 163 times

Re: Argument Error

Posted: Fri Dec 27, 2013 1:41 am
by slime
The implicit "arg" table was deprecated in Lua 5.1. Unfortunately the official online version of the PiL book is written for Lua 5.0, so it gives the wrong advice for this.

Do something like local args = {...}, or local a, b = ... instead.

Re: Argument Error

Posted: Fri Dec 27, 2013 1:49 am
by XCaptain
Thank you for tell me this, didn't know I need to use ... and not arg. :)