# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1558728464 -7200
# Node ID 35932896ce8408ca3fa4b60c40a4382f4ad4d4ef
# Parent  586ebee9de41c2681e07e4c46d985713948fed79
Prevent crates from being collected twice

diff -r 586ebee9de41 -r 35932896ce84 ChangeLog.txt
--- a/ChangeLog.txt	Fri May 24 21:47:20 2019 +0200
+++ b/ChangeLog.txt	Fri May 24 22:07:44 2019 +0200
@@ -26,6 +26,7 @@
  * Use player-chosen team identity in campaigns and singleplayer missions
  * Fix player-chosen teams ignoring custom team controls in campaigns
  * Fix broken behaviour of airborne attacks when placed near bounce world edge
+ * Fix crate sometimes collected twice when switching to hedgehog that touches it
  * Deny placement of airborne attack in “impossible” places in maps with bounce world edge
  * Deny placement of piano beyond bounce world edge
  * Fix laser sight not working properly when it starts out of map bounds
diff -r 586ebee9de41 -r 35932896ce84 hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Fri May 24 21:47:20 2019 +0200
+++ b/hedgewars/uGearsHedgehog.pas	Fri May 24 22:07:44 2019 +0200
@@ -785,6 +785,7 @@
     healthBoost: LongInt;
 begin
 if Gear^.State and gstFrozen <> 0 then exit;
+if Gear^.Message and gmDestroy <> 0 then exit;
 
 Gear^.Message:= gmDestroy;
 if (Gear^.Pos and posCaseExplode) <> 0 then