hedgewars/uScript.pas
changeset 13370 e202d58236b1
parent 13349 40742f3f7dd9
child 13371 da913fc1d350
--- a/hedgewars/uScript.pas	Thu May 03 21:04:55 2018 +0200
+++ b/hedgewars/uScript.pas	Thu May 03 21:40:13 2018 +0200
@@ -560,10 +560,18 @@
 function lc_setammotexts(L : Plua_State) : LongInt; Cdecl;
 const
     call = 'SetAmmoTexts';
-    params = 'ammoType, name, caption, description';
+    params = 'ammoType, name, caption, description [, showExtra]';
+var n: integer;
+    showExtra: boolean;
 begin
-    if CheckLuaParamCount(L, 4, call, params) then
-        SetAmmoTexts(TAmmoType(LuaToAmmoTypeOrd(L, 1, call, params)), lua_tostringA(L, 2), lua_tostringA(L, 3), lua_tostringA(L, 4));
+    if CheckAndFetchParamCount(L, 4, 5, call, params, n) then
+        begin
+        if n = 5 then
+            showExtra:= lua_toboolean(L, 5)
+        else
+            showExtra:= true;
+        SetAmmoTexts(TAmmoType(LuaToAmmoTypeOrd(L, 1, call, params)), lua_tostringA(L, 2), lua_tostringA(L, 3), lua_tostringA(L, 4), showExtra);
+        end;
     lc_setammotexts:= 0;
 end;