hedgewars/uScript.pas
changeset 11172 78f9fd42fa46
parent 11066 f10a4bdfa0f4
child 11173 fe2f269dc80f
equal deleted inserted replaced
11171:546e75fdb879 11172:78f9fd42fa46
   915             lua_pushinteger(L, gear^.Karma);
   915             lua_pushinteger(L, gear^.Karma);
   916             lua_pushnumber(L,  gear^.DirAngle);
   916             lua_pushnumber(L,  gear^.DirAngle);
   917             lua_pushinteger(L, gear^.AdvBounce);
   917             lua_pushinteger(L, gear^.AdvBounce);
   918             lua_pushinteger(L, Integer(gear^.ImpactSound));
   918             lua_pushinteger(L, Integer(gear^.ImpactSound));
   919             lua_pushinteger(L, gear^.nImpactSounds);
   919             lua_pushinteger(L, gear^.nImpactSounds);
   920             lua_pushinteger(L, gear^.Tint)
   920             lua_pushinteger(L, gear^.Tint);
       
   921             lua_pushinteger(L, gear^.Damage)
   921             end
   922             end
   922         else
   923         else
   923             begin
   924             begin
   924             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   925             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   925             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   926             lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   926             lua_pushnil(L)
   927             lua_pushnil(L); lua_pushnil(L)
   927             end
   928             end
   928         end
   929         end
   929     else
   930     else
   930         begin
   931         begin
   931         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   932         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   932         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   933         lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L);
   933         lua_pushnil(L)
   934         lua_pushnil(L); lua_pushnil(L)
   934         end;
   935         end;
   935     lc_getgearvalues:= 11
   936     lc_getgearvalues:= 12
   936 end;
   937 end;
   937 
   938 
   938 function lc_setgearvalues(L : Plua_State) : LongInt; Cdecl;
   939 function lc_setgearvalues(L : Plua_State) : LongInt; Cdecl;
   939 var gear : PGear;
   940 var gear : PGear;
   940 begin
   941 begin
   941 // Currently allows 1-12 params
   942 // Currently allows 1-13 params
   942 //    if CheckLuaParamCount(L, 12, 'SetGearValues', 'gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint') then
   943 //    if CheckLuaParamCount(L, 13, 'SetGearValues', 'gearUid, Damage, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint') then
   943 //        begin
   944 //        begin
   944         gear:= GearByUID(lua_tointeger(L, 1));
   945         gear:= GearByUID(lua_tointeger(L, 1));
   945         if gear <> nil then
   946         if gear <> nil then
   946             begin
   947             begin
   947             if not lua_isnoneornil(L, 2) then
   948             if not lua_isnoneornil(L, 2) then
   963             if not lua_isnoneornil(L, 10) then
   964             if not lua_isnoneornil(L, 10) then
   964                 gear^.ImpactSound := TSound(lua_tointeger(L, 10));
   965                 gear^.ImpactSound := TSound(lua_tointeger(L, 10));
   965             if not lua_isnoneornil(L, 11) then
   966             if not lua_isnoneornil(L, 11) then
   966                 gear^.nImpactSounds := lua_tointeger(L, 11);
   967                 gear^.nImpactSounds := lua_tointeger(L, 11);
   967             if not lua_isnoneornil(L, 12) then
   968             if not lua_isnoneornil(L, 12) then
   968                 gear^.Tint := lua_tointeger(L, 12)
   969                 gear^.Tint := lua_tointeger(L, 12);
       
   970             if not lua_isnoneornil(L, 13) then
       
   971                 gear^.Damage := lua_tointeger(L, 13);
   969             end;
   972             end;
   970 //        end
   973 //        end
   971 //    else
   974 //    else
   972 //        lua_pushnil(L); // return value on stack (nil)
   975 //        lua_pushnil(L); // return value on stack (nil)
   973     lc_setgearvalues:= 0
   976     lc_setgearvalues:= 0