hedgewars/uScript.pas
changeset 9987 8f07b47a641b
parent 9985 42cd42e44c9a
child 9988 317d46a2afd2
equal deleted inserted replaced
9985:42cd42e44c9a 9987:8f07b47a641b
  1195 
  1195 
  1196 function lc_seteffect(L : Plua_State) : LongInt; Cdecl;
  1196 function lc_seteffect(L : Plua_State) : LongInt; Cdecl;
  1197 var gear: PGear;
  1197 var gear: PGear;
  1198 begin
  1198 begin
  1199     if lua_gettop(L) <> 3 then
  1199     if lua_gettop(L) <> 3 then
  1200         LuaParameterCountError('SetEffect', 'gearUid, effect, enabled', lua_gettop(L))
  1200         LuaParameterCountError('SetEffect', 'gearUid, effect, effectState', lua_gettop(L))
  1201     else begin
  1201     else begin
  1202         gear := GearByUID(lua_tointeger(L, 1));
  1202         gear := GearByUID(lua_tointeger(L, 1));
  1203         if (gear <> nil) and (gear^.Hedgehog <> nil) then
  1203         if (gear <> nil) and (gear^.Hedgehog <> nil) then
  1204             gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))]:= lua_tointeger(L, 3);
  1204             gear^.Hedgehog^.Effects[THogEffect(lua_tointeger(L, 2))]:= lua_tointeger(L, 3);
  1205     end;
  1205     end;