hedgewars/uScript.pas
changeset 7573 364cd923db43
parent 7567 da2aa8355d91
child 7628 bc7b1d228a2c
equal deleted inserted replaced
7571:22a7bfa3e6bb 7573:364cd923db43
   978         gear:= GearByUID(lua_tointeger(L, 1));
   978         gear:= GearByUID(lua_tointeger(L, 1));
   979 // should we allow this when there is no current hedgehog? might do some odd(er) things to turn sequence.
   979 // should we allow this when there is no current hedgehog? might do some odd(er) things to turn sequence.
   980         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) and (CurrentHedgehog <> nil) then
   980         if (gear <> nil) and (gear^.Kind = gtHedgehog) and (gear^.Hedgehog <> nil) and (CurrentHedgehog <> nil) then
   981             begin
   981             begin
   982             prevgear := CurrentHedgehog^.Gear;
   982             prevgear := CurrentHedgehog^.Gear;
   983             prevgear^.Active := false;
   983             if prevgear <> nil then
   984             prevgear^.State:= prevgear^.State and (not gstHHDriven);
   984                 begin
   985             prevgear^.Z := cHHZ;
   985                 prevgear^.Active := false;
   986             prevgear^.Message:= prevgear^.Message or gmRemoveFromList or gmAddToList;
   986                 prevgear^.State:= prevgear^.State and (not gstHHDriven);
       
   987                 prevgear^.Z := cHHZ;
       
   988                 prevgear^.Message:= prevgear^.Message or gmRemoveFromList or gmAddToList;
       
   989                 end;
   987             
   990             
   988             SwitchCurrentHedgehog(gear^.Hedgehog);
   991             SwitchCurrentHedgehog(gear^.Hedgehog);
   989             CurrentTeam:= CurrentHedgehog^.Team;
   992             CurrentTeam:= CurrentHedgehog^.Team;
   990 
   993 
   991             gear^.State:= gear^.State or gstHHDriven;
   994             gear^.State:= gear^.State or gstHHDriven;