hedgewars/uScript.pas
changeset 12286 b4dde7035fe2
parent 12162 e4294b5cc2e7
child 12294 0deabf747b8f
--- a/hedgewars/uScript.pas	Wed Apr 19 08:35:31 2017 -0400
+++ b/hedgewars/uScript.pas	Wed Apr 19 17:50:31 2017 +0200
@@ -1861,6 +1861,19 @@
     lc_endgame:= 0
 end;
 
+function lc_endturn(L : Plua_State) : LongInt; Cdecl;
+var n: LongInt;
+const
+    call = 'EndTurn';
+    params = '[noTaunts]';
+begin
+    if CheckAndFetchParamCount(L, 0, 1, call, params, n) then
+        if n >= 1 then
+            LuaNoEndTurnTaunts:= lua_toboolean(L, 1);
+    LuaEndTurnRequested:= true;
+    lc_endturn:= 0
+end;
+
 function lc_sendstat(L : Plua_State) : LongInt; Cdecl;
 var statInfo : TStatInfoType;
     i, n     : LongInt;
@@ -3392,6 +3405,7 @@
 lua_register(luaState, _P'WriteLnToConsole', @lc_writelntoconsole);
 lua_register(luaState, _P'GetGearType', @lc_getgeartype);
 lua_register(luaState, _P'EndGame', @lc_endgame);
+lua_register(luaState, _P'EndTurn', @lc_endturn);
 lua_register(luaState, _P'SendStat', @lc_sendstat);
 lua_register(luaState, _P'SendHealthStatsOff', @lc_sendhealthstatsoff);
 lua_register(luaState, _P'FindPlace', @lc_findplace);