hedgewars/uAmmos.pas
changeset 12649 2837dee472cc
parent 12156 9755922396f5
child 12671 87b3009f51c3
--- a/hedgewars/uAmmos.pas	Wed Oct 04 21:33:05 2017 +0200
+++ b/hedgewars/uAmmos.pas	Thu Oct 05 01:37:49 2017 +0200
@@ -378,15 +378,14 @@
 
 procedure ApplyAmmoChanges(var Hedgehog: THedgehog);
 var s: ansistring;
-    CurWeapon: PAmmo;
+    OldWeapon, CurWeapon: PAmmo;
 begin
 TargetPoint.X:= NoPointX;
 
 with Hedgehog do
     begin
-    Timer:= 10;
-
     CurWeapon:= GetCurAmmoEntry(Hedgehog);
+    OldWeapon:= GetCurAmmoEntry(Hedgehog);
 
     if (CurWeapon^.Count = 0) then
         SwitchToFirstLegalAmmo(Hedgehog)
@@ -395,6 +394,10 @@
 
     CurWeapon:= GetCurAmmoEntry(Hedgehog);
 
+    // Weapon selection animation (if new ammo type)
+    if CurWeapon^.AmmoType <> OldWeapon^.AmmoType then
+        Timer:= 10;
+
     ApplyAngleBounds(Hedgehog, CurWeapon^.AmmoType);
 
     with CurWeapon^ do