919 lua_pushnumber(L, gear^.DirAngle); |
919 lua_pushnumber(L, gear^.DirAngle); |
920 lua_pushinteger(L, gear^.AdvBounce); |
920 lua_pushinteger(L, gear^.AdvBounce); |
921 lua_pushinteger(L, Integer(gear^.ImpactSound)); |
921 lua_pushinteger(L, Integer(gear^.ImpactSound)); |
922 lua_pushinteger(L, gear^.nImpactSounds); |
922 lua_pushinteger(L, gear^.nImpactSounds); |
923 lua_pushinteger(L, gear^.Tint); |
923 lua_pushinteger(L, gear^.Tint); |
924 lua_pushinteger(L, gear^.Damage) |
924 lua_pushinteger(L, gear^.Damage); |
|
925 lua_pushinteger(L, gear^.Boom) |
925 end |
926 end |
926 else |
927 else |
927 begin |
928 begin |
928 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
929 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
929 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
930 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
930 lua_pushnil(L); lua_pushnil(L) |
931 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L) |
931 end |
932 end |
932 end |
933 end |
933 else |
934 else |
934 begin |
935 begin |
935 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
936 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
936 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
937 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); lua_pushnil(L); |
937 lua_pushnil(L); lua_pushnil(L) |
938 lua_pushnil(L); lua_pushnil(L); lua_pushnil(L) |
938 end; |
939 end; |
939 lc_getgearvalues:= 12 |
940 lc_getgearvalues:= 13 |
940 end; |
941 end; |
941 |
942 |
942 function lc_setgearvalues(L : Plua_State) : LongInt; Cdecl; |
943 function lc_setgearvalues(L : Plua_State) : LongInt; Cdecl; |
943 var gear : PGear; |
944 var gear : PGear; |
944 begin |
945 begin |
945 // Currently allows 1-13 params |
946 // Currently allows 1-14 params |
946 // if CheckLuaParamCount(L, 13, 'SetGearValues', 'gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint, Damage') then |
947 // if CheckLuaParamCount(L, 14, 'SetGearValues', 'gearUid, Angle, Power, WDTimer, Radius, Density, Karma, DirAngle, AdvBounce, ImpactSound, # ImpactSounds, Tint, Damage, Boom') then |
947 // begin |
948 // begin |
948 gear:= GearByUID(lua_tointeger(L, 1)); |
949 gear:= GearByUID(lua_tointeger(L, 1)); |
949 if gear <> nil then |
950 if gear <> nil then |
950 begin |
951 begin |
951 if not lua_isnoneornil(L, 2) then |
952 if not lua_isnoneornil(L, 2) then |
970 gear^.nImpactSounds := lua_tointeger(L, 11); |
971 gear^.nImpactSounds := lua_tointeger(L, 11); |
971 if not lua_isnoneornil(L, 12) then |
972 if not lua_isnoneornil(L, 12) then |
972 gear^.Tint := lua_tointeger(L, 12); |
973 gear^.Tint := lua_tointeger(L, 12); |
973 if not lua_isnoneornil(L, 13) then |
974 if not lua_isnoneornil(L, 13) then |
974 gear^.Damage := lua_tointeger(L, 13); |
975 gear^.Damage := lua_tointeger(L, 13); |
|
976 if not lua_isnoneornil(L, 14) then |
|
977 gear^.Boom := lua_tointeger(L, 14); |
975 end; |
978 end; |
976 // end |
979 // end |
977 // else |
980 // else |
978 // lua_pushnil(L); // return value on stack (nil) |
981 // lua_pushnil(L); // return value on stack (nil) |
979 lc_setgearvalues:= 0 |
982 lc_setgearvalues:= 0 |