Hi,
Erich Schubert wrote:
I've been using the included lua for some versions now. I noticed I
didn't really test r472; I've built a package of r473 but it also has
the same problem.
Please find attached a small patch that sets some redundant braces. It
sounds like the else clause is attached to the wrong if statement. But
that would be a major compiler bug.
Otherwise just delete the else clause as and check if Enigma is running.
The else clause just protects faulty levels to crash the app.
Ronald
Index: src/lua.cc
===================================================================
--- src/lua.cc (revision 469)
+++ src/lua.cc (working copy)
@@ -358,12 +358,14 @@
double x = lua_tonumber(L,1);
double y = lua_tonumber(L,2);
Actor *ac = dynamic_cast<Actor*>(to_object(L, 3));
- if( ! ac)
+ if( ! ac) {
throwLuaError(L, "object is no valid actor");
- if (world::IsInsideLevel(GridPos(round_down<int>(x), round_down<int>(y))))
+ }
+ if (world::IsInsideLevel(GridPos(round_down<int>(x), round_down<int>(y))))
{
world::AddActor(x, y, ac);
- else
+ } else {
throwLuaError(L, "position is outside of world");
+ }
return 0;
}
_______________________________________________
Enigma-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/enigma-devel