# HG changeset patch # User sheepluva # Date 1481401690 -3600 # Node ID 0695302f3f5fe11c5a6b175b53aa6943cbc515dc # Parent 9bc19f72216984d5f8e52568901f10b9de2c6aaa Fix ScriptExists() destroying lua stack (fixes Bug #146) diff -r 9bc19f722169 -r 0695302f3f5f hedgewars/uScript.pas --- a/hedgewars/uScript.pas Sat Dec 10 19:09:25 2016 +0100 +++ b/hedgewars/uScript.pas Sat Dec 10 21:28:10 2016 +0100 @@ -23,7 +23,7 @@ * This unit defines, implements and registers functions and * variables/constants bindings for usage in Lua scripts. * - * Please keep http://hedgewars.org/kb/LuaAPI up to date! + * Please keep https://hedgewars.org/kb/LuaAPI up to date! * * Note: If you add a new function, make sure to test if _all_ parameters * work as intended! (Especially conversions errors can sneak in @@ -3131,7 +3131,7 @@ end; lua_getglobal(luaState, Str2PChar(fname)); ScriptExists:= not lua_isnoneornil(luaState, -1); -lua_pop(luaState, -1) +lua_pop(luaState, 1) end; procedure ScriptPrepareAmmoStore;