# HG changeset patch # User nemo # Date 1442176599 14400 # Node ID 78f9fd42fa468ce9909912d6c0fff4f1ecc7768a # Parent 546e75fdb879b85fb2c79143685da7542e221bc6 Add damage to gear values to mess with diff -r 546e75fdb879 -r 78f9fd42fa46 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