hedgewars/uAmmos.pas
changeset 12649 2837dee472cc
parent 12156 9755922396f5
child 12671 87b3009f51c3
equal deleted inserted replaced
12648:c755afd8fb6b 12649:2837dee472cc
   376     end
   376     end
   377 end;
   377 end;
   378 
   378 
   379 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
   379 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
   380 var s: ansistring;
   380 var s: ansistring;
   381     CurWeapon: PAmmo;
   381     OldWeapon, CurWeapon: PAmmo;
   382 begin
   382 begin
   383 TargetPoint.X:= NoPointX;
   383 TargetPoint.X:= NoPointX;
   384 
   384 
   385 with Hedgehog do
   385 with Hedgehog do
   386     begin
   386     begin
   387     Timer:= 10;
       
   388 
       
   389     CurWeapon:= GetCurAmmoEntry(Hedgehog);
   387     CurWeapon:= GetCurAmmoEntry(Hedgehog);
       
   388     OldWeapon:= GetCurAmmoEntry(Hedgehog);
   390 
   389 
   391     if (CurWeapon^.Count = 0) then
   390     if (CurWeapon^.Count = 0) then
   392         SwitchToFirstLegalAmmo(Hedgehog)
   391         SwitchToFirstLegalAmmo(Hedgehog)
   393     else if CurWeapon^.AmmoType = amNothing then
   392     else if CurWeapon^.AmmoType = amNothing then
   394         Hedgehog.CurAmmoType:= amNothing;
   393         Hedgehog.CurAmmoType:= amNothing;
   395 
   394 
   396     CurWeapon:= GetCurAmmoEntry(Hedgehog);
   395     CurWeapon:= GetCurAmmoEntry(Hedgehog);
       
   396 
       
   397     // Weapon selection animation (if new ammo type)
       
   398     if CurWeapon^.AmmoType <> OldWeapon^.AmmoType then
       
   399         Timer:= 10;
   397 
   400 
   398     ApplyAngleBounds(Hedgehog, CurWeapon^.AmmoType);
   401     ApplyAngleBounds(Hedgehog, CurWeapon^.AmmoType);
   399 
   402 
   400     with CurWeapon^ do
   403     with CurWeapon^ do
   401         begin
   404         begin