CTF: Drop flag when carrier uses piano strike
authorWuzzy <Wuzzy2@mail.ru>
Thu, 08 Mar 2018 12:46:11 +0100
changeset 13115 efcdf31684ca
parent 13114 59ebdb80d693
child 13116 10c914738f22
CTF: Drop flag when carrier uses piano strike
ChangeLog.txt
share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua
--- a/ChangeLog.txt	Thu Mar 08 12:34:46 2018 +0100
+++ b/ChangeLog.txt	Thu Mar 08 12:46:11 2018 +0100
@@ -52,7 +52,9 @@
  + Control: Always remove TimeBox and Resurrector
  * Battalion: Some texts in the mission panel were wrong and misleading
  * Construction Mode: Remove drill strike if added by weapon scheme (it's broken)
- * Capture the Flag: Properly place flag when using kamikaze or TimeBox
+ * Capture the Flag: Fix many bugs caused by playing with >2 teams
+ * Capture the Flag: Properly place flag when first hog uses kamikaze or TimeBox
+ * Capture the Flag: Fix flag not being dropped when carrier uses piano strike
 
 A Space Adventure:
  + Precise Shooting: Display collected ammo
--- 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