Fix player being able to switch to dying hog
authorWuzzy <almikes@aol.com>
Mon, 09 Oct 2017 14:31:46 +0200
changeset 12679 6f05a02d43b2
parent 12678 fb240fa9f178
child 12680 5a253f158071
Fix player being able to switch to dying hog
ChangeLog.txt
hedgewars/uGearsHandlersMess.pas
--- a/ChangeLog.txt	Sun Oct 08 23:34:14 2017 +0200
+++ b/ChangeLog.txt	Mon Oct 09 14:31:46 2017 +0200
@@ -55,6 +55,7 @@
  * Fixed team getting infinite ammo when stockpiling >= 100 ammo (max. finite ammo is now limited to 99)
  * Fixed short sound effect breakdown right after using a time box
  * Fixed sticky mine sound sometimes playing when shooting portable portal device when a sticky mine is placed on terrain
+ * Fixed player being able to switch to dying hog
  * Remove buggy /finish chat command
  * Various other fixes
 
--- a/hedgewars/uGearsHandlersMess.pas	Sun Oct 08 23:34:14 2017 +0200
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Oct 09 14:31:46 2017 +0200
@@ -2968,6 +2968,8 @@
             CurrentTeam^.CurrHedgehog := (CurrentTeam^.CurrHedgehog + switchDir) mod CurrentTeam^.HedgehogsNumber;
         until (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear <> nil) and
               (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Damage = 0) and
+              (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Health > 0) and
+              ((CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.State and gstHHDeath) = 0) and
               (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Effects[heFrozen]=0);
 
         SwitchCurrentHedgehog(@CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog]);