equal
deleted
inserted
replaced
134 else |
134 else |
135 s:= 'LUA ERROR: ' + s; |
135 s:= 'LUA ERROR: ' + s; |
136 WriteLnToConsole(s); |
136 WriteLnToConsole(s); |
137 AddChatString(#5 + s); |
137 AddChatString(#5 + s); |
138 if cTestLua then |
138 if cTestLua then |
139 halt(rtnTestLuaErr); |
139 halt(HaltTestLuaError); |
140 end; |
140 end; |
141 |
141 |
142 procedure LuaCallError(error, call, paramsyntax: shortstring); |
142 procedure LuaCallError(error, call, paramsyntax: shortstring); |
143 begin |
143 begin |
144 LuaError(call + ': ' + error); |
144 LuaError(call + ': ' + error); |
2847 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload); |
2847 lua_register(luaState, _P'HedgewarsScriptLoad', @lc_hedgewarsscriptload); |
2848 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement); |
2848 lua_register(luaState, _P'DeclareAchievement', @lc_declareachievement); |
2849 |
2849 |
2850 if cTestLua then |
2850 if cTestLua then |
2851 begin |
2851 begin |
2852 ScriptSetInteger('TEST_SUCCESSFUL' ,rtnTestSuccess); |
2852 ScriptSetInteger('TEST_SUCCESSFUL' , HaltTestSuccess); |
2853 ScriptSetInteger('TEST_FAILED' ,rtnTestFailed); |
2853 ScriptSetInteger('TEST_FAILED' , HaltTestFailed); |
2854 lua_register(luaState, _P'EndLuaTest', @lc_endluatest); |
2854 lua_register(luaState, _P'EndLuaTest', @lc_endluatest); |
2855 end; |
2855 end; |
2856 |
2856 |
2857 ScriptClearStack; // just to be sure stack is empty |
2857 ScriptClearStack; // just to be sure stack is empty |
2858 ScriptLoaded:= false; |
2858 ScriptLoaded:= false; |