----- Original Message -----
From: "Andreas Lochmann" <[EMAIL PROTECTED]>
To: "Tacvek" <[EMAIL PROTECTED]>
Cc: <enigma-devel@nongnu.org>
Sent: Monday, June 19, 2006 6:36 AM
Subject: Re: [Enigma-devel] ant33.lua runtime error under lua 5
Tacvek wrote:
Some sort of runtime error occurs in ant33.lua ("Unfair!"). This happens
when the player fist steps on the trigger.
The error message is cut short because it does not wrap, so I cannot
debug at this time. Can somebody take a look at it?
The full error-message is:
Server Error: level runtime error
callback 'action_A' failed:
.../ant.lua:141: attempt to compare userdata with number
(and, yes, it is annoying that error-messages don't wrap
in lower resolutions)
This looks like a type-cast-problem in ant.lua, and appears
a second time on the 'action_C'-triggers in ant33.
I don't understand the ant.lua-magic, so I only could do a
workaround for ant33 - a not beautiful one. And we should
assume that there are more levels using this very special
cell/cells-syntax.
Actually, I'm betting we failed to convert ant.lua over to 5.1 quite
correctly.
My guess:
It has to do with how upvalues in functions were resolved at function
construction time in Lua 4, while in lua 5.0+ if just the variable name is
used, it is resolved when the function is run.
Take a look at line 361 of ant.lua. Here an anonymous function is created
and returned. This happens each time the cell function is run. Previously,
any upvalues would be resolved while running the cell function. Now any such
values are only resolved when the function returned by cell is run.
There is a workaround, described in
http://lua-users.org/lists/lua-l/2005-11/msg00314.html .
However, perhaps that is not the cause, because the error message claims the
error occurs elsewhere. I can't see where any of the relevent tables could
be picking up userdata. Besides, using the above fix, but deep copying the
tables does not seem to fix the problem.
A lua expert really needs to look at this.
_______________________________________________
Enigma-devel mailing list
Enigma-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/enigma-devel