# HG changeset patch
# User Wuzzy <Wuzzy2@mail.ru>
# Date 1544406027 -3600
# Node ID 352ea82355aeb12510528dd8ad6e40b5ed5b08c7
# Parent  87562a68c41fa7b368100e9e27311d950eb8c038
End turn immediately if king of own team was killed

diff -r 87562a68c41f -r 352ea82355ae hedgewars/uGearsHedgehog.pas
--- a/hedgewars/uGearsHedgehog.pas	Mon Dec 10 02:30:14 2018 +0100
+++ b/hedgewars/uGearsHedgehog.pas	Mon Dec 10 02:40:27 2018 +0100
@@ -1307,7 +1307,7 @@
 else if not isInMultiShoot then
     AllInactive:= false;
 
-if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) or (LuaEndTurnRequested = true) then
+if (TurnTimeLeft = 0) or (HHGear^.Damage > 0) or (((GameFlags and gfKing) <> 0) and (not Hedgehog^.Team^.hasKing)) or (LuaEndTurnRequested = true) then
     begin
     if (Hedgehog^.CurAmmoType = amKnife) then
        LoadHedgehogHat(Hedgehog^, Hedgehog^.Hat);