equal
deleted
inserted
replaced
21 unit uScript; |
21 unit uScript; |
22 (* |
22 (* |
23 * This unit defines, implements and registers functions and |
23 * This unit defines, implements and registers functions and |
24 * variables/constants bindings for usage in Lua scripts. |
24 * variables/constants bindings for usage in Lua scripts. |
25 * |
25 * |
26 * Please keep http://hedgewars.org/kb/LuaAPI up to date! |
26 * Please keep https://hedgewars.org/kb/LuaAPI up to date! |
27 * |
27 * |
28 * Note: If you add a new function, make sure to test if _all_ parameters |
28 * Note: If you add a new function, make sure to test if _all_ parameters |
29 * work as intended! (Especially conversions errors can sneak in |
29 * work as intended! (Especially conversions errors can sneak in |
30 * unnoticed and render the parameter useless!) |
30 * unnoticed and render the parameter useless!) |
31 *) |
31 *) |
3129 ScriptExists:= false; |
3129 ScriptExists:= false; |
3130 exit |
3130 exit |
3131 end; |
3131 end; |
3132 lua_getglobal(luaState, Str2PChar(fname)); |
3132 lua_getglobal(luaState, Str2PChar(fname)); |
3133 ScriptExists:= not lua_isnoneornil(luaState, -1); |
3133 ScriptExists:= not lua_isnoneornil(luaState, -1); |
3134 lua_pop(luaState, -1) |
3134 lua_pop(luaState, 1) |
3135 end; |
3135 end; |
3136 |
3136 |
3137 procedure ScriptPrepareAmmoStore; |
3137 procedure ScriptPrepareAmmoStore; |
3138 var i: ShortInt; |
3138 var i: ShortInt; |
3139 begin |
3139 begin |