Portal mission: Fix speech bubbles appearing when crate got destroyed
authorWuzzy <almikes@aol.com>
Mon, 18 Apr 2016 17:33:07 +0200
changeset 11670 be57b0e3e289
parent 11669 66ddc8c5ecd7
child 11671 51c4ea6d7f91
Portal mission: Fix speech bubbles appearing when crate got destroyed
share/hedgewars/Data/Missions/Training/portal.lua
--- a/share/hedgewars/Data/Missions/Training/portal.lua	Mon Apr 18 17:26:32 2016 +0200
+++ b/share/hedgewars/Data/Missions/Training/portal.lua	Mon Apr 18 17:33:07 2016 +0200
@@ -177,23 +177,25 @@
 end
 	
 function onGearDelete(gear)
+	-- Check gear collection
+	if CurrentHedgehog == player and (band(GetGearMessage(gear), gmDestroy) ~= 0) then
+		if gear == portalgun then
+			HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
+		end
 
-	if gear == portalgun then
-		HogSay(player, loc("Great! Let’s kill all these enemies, using portals."), SAY_THINK)
+		if gear == girder then 
+			HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
+		end
+	
+		if gear == parachute then
+			HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
+		end
+
+		if gear == extratime then
+			HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
+		end
 	end
 
-	if gear == girder then 
-		HogSay(player, loc("This will be useful when I need a new platform or if I want to rise."), SAY_THINK)
-	end
-	
-	if gear == parachute then
-		HogSay(player, loc("You can’t open a portal on the blue surface."), SAY_THINK)
-	end
-
-	if gear == extratime then
-		HogSay(player, loc("What?! For all this struggle I just win some ... time? Oh dear!"), SAY_SHOUT)
-	end
-	
 	if gear == player then
 		player = nil
 	end