Rope Knock Challenge: Don't count hog kills after hero hurt itself
authorWuzzy <Wuzzy2@mail.ru>
Mon, 23 Oct 2017 03:01:10 +0200
changeset 12739 2f873afda0e2
parent 12738 49c45424a333
child 12740 cae0b3139ff7
Rope Knock Challenge: Don't count hog kills after hero hurt itself
share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua
--- a/share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua	Mon Oct 23 02:52:01 2017 +0200
+++ b/share/hedgewars/Data/Missions/Challenge/User_Mission_-_Rope_Knock_Challenge.lua	Mon Oct 23 03:01:10 2017 +0200
@@ -5,6 +5,7 @@
 local endTimer = 1000
 local hogsKilled = 0
 local finishTime
+local ouchies = false
 
 local HogData =	{
 					{"amn",			"NinjaFull",false},
@@ -221,7 +222,11 @@
 
 function onGearDamage(gear, damage)
 
-	if gear ~= hhs[0] and GetGearType(gear) == gtHedgehog then
+	if gear == hhs[0] then
+		ouchies = true
+	end
+
+	if gear ~= hhs[0] and GetGearType(gear) == gtHedgehog and missionWon == nil and ouchies == false then
 
 		AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 		DeleteGear(gear)