# HG changeset patch # User Wuzzy # Date 1547674767 -3600 # Node ID 4638aa2ea8f2efc571a16ff8eadb20a0e5682012 # Parent c3c0f94a53336db546770baa49e89fb4c7ceec79 Update clan passive status when team died / got resurrected diff -r c3c0f94a5333 -r 4638aa2ea8f2 hedgewars/uGearsHandlersMess.pas --- a/hedgewars/uGearsHandlersMess.pas Wed Jan 16 21:32:25 2019 +0100 +++ b/hedgewars/uGearsHandlersMess.pas Wed Jan 16 22:39:27 2019 +0100 @@ -5994,6 +5994,8 @@ resgear^.Hedgehog^.Team^.hasKing:= true; { Reviving a hog implies its clan is now alive, too. } resgear^.Hedgehog^.Team^.Clan^.DeathLogged:= false; + if (not resgear^.Hedgehog^.Team^.Passive) then + resgear^.Hedgehog^.Team^.Clan^.Passive:= false; s:= ansistring(resgear^.Hedgehog^.Name); AddCaption(FormatA(GetEventString(eidResurrected), s), capcolDefault, capgrpMessage); // only make hat-less hedgehogs look like zombies, preserve existing hats diff -r c3c0f94a5333 -r 4638aa2ea8f2 hedgewars/uGearsList.pas --- a/hedgewars/uGearsList.pas Wed Jan 16 21:32:25 2019 +0100 +++ b/hedgewars/uGearsList.pas Wed Jan 16 22:39:27 2019 +0100 @@ -866,6 +866,25 @@ Hedgehogs[t].GearHidden^.Health:= 0 // hog is still hidden. if tardis should return though, lua, eh... end; + // Update passive status of clan + if (not Gear^.Hedgehog^.Team^.Clan^.Passive) then + begin + Gear^.Hedgehog^.Team^.Clan^.Passive:= true; + for i:= 0 to Pred(team^.Clan^.TeamsNumber) do + begin + with team^.Clan^.Teams[i]^ do + if (not Passive) then + for t:= 0 to cMaxHHIndex do + if (Hedgehogs[t].Gear <> nil) or (Hedgehogs[t].GearHidden <> nil) then + begin + Gear^.Hedgehog^.Team^.Clan^.Passive:= false; + break; + end; + if (not Gear^.Hedgehog^.Team^.Clan^.Passive) then + break; + end; + end; + // should be not CurrentHedgehog, but hedgehog of the last gear which caused damage to this hog // same stand for CheckHHDamage if (Gear^.LastDamage <> nil) and (CurrentHedgehog <> nil) then