Fix Lua error spam in "Chasing the blue hog" after drowning both Crazy Runner and Hog Solo
authorWuzzy <almikes@aol.com>
Sat, 21 Nov 2015 21:23:05 +0100
changeset 11497 806da449d355
parent 11495 fb7817a5c2b1
child 11498 62da13a15aff
child 11499 e02f2e98bf71
Fix Lua error spam in "Chasing the blue hog" after drowning both Crazy Runner and Hog Solo
share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua
--- a/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Sat Nov 21 21:11:13 2015 +0100
+++ b/share/hedgewars/Data/Missions/Campaign/A_Space_Adventure/moon02.lua	Sat Nov 21 21:23:05 2015 +0100
@@ -184,7 +184,8 @@
 ------------- other functions ---------------
 
 function isHeroNextToRunner()
-	if GetHealth(hero.gear) and math.abs(GetX(hero.gear) - GetX(runner.gear)) < 75 and
+	if GetGearType(hero.gear) == gtHedgehog and GetGearType(runner.gear) == gtHedgehog and
+			math.abs(GetX(hero.gear) - GetX(runner.gear)) < 75 and
 			math.abs(GetY(hero.gear) - GetY(runner.gear)) < 75 and StoppedGear(hero.gear) then
 		return true
 	end