share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
changeset 13115 efcdf31684ca
parent 13114 59ebdb80d693
child 13116 10c914738f22
--- a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Thu Mar 08 12:34:46 2018 +0100
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua	Thu Mar 08 12:46:11 2018 +0100
@@ -509,15 +509,16 @@
 
 function onGearResurrect(gear)
 
-	-- mark the flag thief as dead if he needed a respawn
-	for i = 0,1 do
-		if gear == fThief[i] then
-			FlagThiefDead(gear)
+	if GetGearType(gear) == gtHedgehog then
+		-- mark the flag thief as dead if he needed a respawn
+		for i = 0,1 do
+			if gear == fThief[i] then
+				FlagThiefDead(gear)
+			end
 		end
+		AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
 	end
 
-	AddVisualGear(GetX(gear), GetY(gear), vgtBigExplosion, 0, false)
-
 end
 
 function InABetterPlaceNow(gear)
@@ -562,10 +563,9 @@
 		SetEffect(gear, heResurrectable, 1)
 
 	elseif GetGearType(gear) == gtPiano then
-
 		for i = 0, 1 do
 			if CurrentHedgehog == fThief[i] then
-				FlagThiefDead(gear)
+				FlagThiefDead(CurrentHedgehog)
 			end
 		end