Never enable switcher while in the "Place your King" round
authorWuzzy <Wuzzy2@mail.ru>
Sat, 01 Dec 2018 02:37:05 +0100
changeset 14356 ce7f9f7cd359
parent 14355 31717e1436cd
child 14357 2ba1f4a971ca
Never enable switcher while in the "Place your King" round
hedgewars/uTeams.pas
--- a/hedgewars/uTeams.pas	Fri Nov 30 22:37:29 2018 +0300
+++ b/hedgewars/uTeams.pas	Sat Dec 01 02:37:05 2018 +0100
@@ -435,7 +435,11 @@
         NextClan:= false;
         end;
 
-    if ((GameFlags and gfSwitchHog) <> 0) and (not CurrentTeam^.hasGone) then
+    // Enable switching mode when gfSwitchHog is active
+    if ((GameFlags and gfSwitchHog) <> 0) and (not CurrentTeam^.hasGone) and
+            // Exception: During the special "Place your King" round in King Mode;
+            // you're not supposed to switch away from your king in this round.
+            (not (((GameFlags and gfKing) <> 0) and ((GameFlags and gfPlaceHog) = 0) and (TotalRoundsReal <= 0))) then
         begin
         g:= AddGear(hwRound(CurrentHedgehog^.Gear^.X), hwRound(CurrentHedgehog^.Gear^.Y), gtSwitcher, 0, _0, _0, 0);
         CurAmmoGear:= g;