Add damage to gear values to mess with
authornemo
Sun, 13 Sep 2015 16:36:39 -0400
changeset 11176 78f9fd42fa46
parent 11175 546e75fdb879
child 11177 fe2f269dc80f
Add damage to gear values to mess with
hedgewars/uScript.pas
--- a/hedgewars/uScript.pas	Sun Sep 13 16:24:37 2015 -0400
+++ b/hedgewars/uScript.pas	Sun Sep 13 16:36:39 2015 -0400
@@ -917,29 +917,30 @@
             lua_pushinteger(L, gear^.AdvBounce);
             lua_pushinteger(L, Integer(gear^.ImpactSound));
             lua_pushinteger(L, gear^.nImpactSounds);
-            lua_pushinteger(L, gear^.Tint)
+            lua_pushinteger(L, gear^.Tint);
+            lua_pushinteger(L, gear^.Damage)
             end
         else
             begin
             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
-            lua_pushnil(L)
+            lua_pushnil(L); lua_pushnil(L)
             end
         end
     else
         begin
         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
-        lua_pushnil(L)
+        lua_pushnil(L); lua_pushnil(L)
         end;
-    lc_getgearvalues:= 11
+    lc_getgearvalues:= 12
 end;
 
 function lc_setgearvalues(L : Plua_State) : LongInt; Cdecl;
 var gear : PGear;
 begin
-// Currently allows 1-12 params
-//    if CheckLuaParamCount(L, 12, 'SetGearValues', 'gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint') then
+// Currently allows 1-13 params
+//    if CheckLuaParamCount(L, 13, 'SetGearValues', 'gearUid, Damage, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint') then
 //        begin
         gear:= GearByUID(lua_tointeger(L, 1));
         if gear <> nil then
@@ -965,7 +966,9 @@
             if not lua_isnoneornil(L, 11) then
                 gear^.nImpactSounds := lua_tointeger(L, 11);
             if not lua_isnoneornil(L, 12) then
-                gear^.Tint := lua_tointeger(L, 12)
+                gear^.Tint := lua_tointeger(L, 12);
+            if not lua_isnoneornil(L, 13) then
+                gear^.Damage := lua_tointeger(L, 13);
             end;
 //        end
 //    else