--- 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