# HG changeset patch # User Wuzzy # Date 1563413998 -7200 # Node ID 515a4a317e52d2842543b24ac984f47f1fdccbbd # Parent 9be05ae1b726976b050025c0ad6a4199c7beefa3 CTF: Fix clan not winning if enemy hog was time-travelling diff -r 9be05ae1b726 -r 515a4a317e52 ChangeLog.txt --- a/ChangeLog.txt Thu Jul 18 03:25:15 2019 +0200 +++ b/ChangeLog.txt Thu Jul 18 03:39:58 2019 +0200 @@ -506,6 +506,7 @@ * 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 + * Capture the Flag: Fix clan not winning if enemy was in time travel * CTF_Blizzard: Don't allow more than 2 clans. Excess hogs will be removed A Space Adventure: diff -r 9be05ae1b726 -r 515a4a317e52 share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua --- a/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua Thu Jul 18 03:25:15 2019 +0200 +++ b/share/hedgewars/Data/Scripts/Multiplayer/Capture_the_Flag.lua Thu Jul 18 03:39:58 2019 +0200 @@ -89,6 +89,7 @@ local gameStarted = false local gameOver = false +local winningClan = -1 local captureLimit = 3 -------------------------- @@ -178,11 +179,12 @@ if fCaptures[clanID] == captureLimit then gameOver = true + winningClan = clanID -- Capture limit reached! We have a winner! for i = 0, (numhhs-1) do if hhs[i] ~= nil then -- Kill all losers - if GetHogClan(hhs[i]) ~= clanID then + if GetHogClan(hhs[i]) ~= winningClan then SetEffect(hhs[i], heResurrectable, 0) SetHealth(hhs[i],0) end @@ -629,6 +631,10 @@ break end end + if gameOver and GetHogClan(gear) ~= winningClan then + SetEffect(gear, heResurrectable, 0) + SetHealth(gear, 0) + end end function onHogAttack(ammoType)