hedgewars/uGearsHedgehog.pas
changeset 12912 a840fd55caa6
parent 12898 8a40ce061d94
child 12937 a84a05719454
equal deleted inserted replaced
12911:20f389ae90b5 12912:a840fd55caa6
   139 s:= false;
   139 s:= false;
   140 
   140 
   141 weap:= TAmmoType(HHGear^.MsgParam);
   141 weap:= TAmmoType(HHGear^.MsgParam);
   142 Hedgehog:= HHGear^.Hedgehog;
   142 Hedgehog:= HHGear^.Hedgehog;
   143 
   143 
       
   144 HHGear^.Message:= HHGear^.Message and (not gmWeapon);
       
   145 
       
   146 // Special case: amNothing unselects weapon
       
   147 if weap = amNothing then
       
   148     begin
       
   149     HHGear^.Hedgehog^.CurAmmoType:= amNothing;
       
   150     ApplyAmmoChanges(HHGear^.Hedgehog^);
       
   151     exit
       
   152     end;
       
   153 
   144 if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then
   154 if Hedgehog^.Team^.Clan^.TurnNumber <= Ammoz[weap].SkipTurns then
   145     exit; // weapon is not activated yet
   155     exit; // weapon is not activated yet
   146 
   156 
   147 HHGear^.MsgParam:= Ammoz[weap].Slot;
   157 HHGear^.MsgParam:= Ammoz[weap].Slot;
   148 
   158 
   149 t:= cMaxSlotAmmoIndex;
   159 t:= cMaxSlotAmmoIndex;
   150 
       
   151 HHGear^.Message:= HHGear^.Message and (not gmWeapon);
       
   152 
   160 
   153 prevState:= HHGear^.State;
   161 prevState:= HHGear^.State;
   154 newState:= prevState;
   162 newState:= prevState;
   155 with Hedgehog^ do
   163 with Hedgehog^ do
   156     while (CurAmmoType <> weap) and (t >= 0) do
   164     while (CurAmmoType <> weap) and (t >= 0) do