From fcda5cb46cf3163b37e8d0352527e8090f523371 Mon Sep 17 00:00:00 2001 From: foin137 Date: Fri, 29 Jan 2021 20:07:41 +0100 Subject: [PATCH] [#26] Fix bug when removing players Makes sure that the game can continue when waiting for and removing a player --- Werwolf.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Werwolf.php b/Werwolf.php index 802b3b2..0612abb 100644 --- a/Werwolf.php +++ b/Werwolf.php @@ -3937,9 +3937,14 @@ function diesesSpielLoeschenButton() } function aus_spiel_entfernen($spielerID, $mysqli) { - $spielID = $_COOKIE['SpielID']; + $spielID = (int)$_COOKIE['SpielID']; $spielerID = (int)$spielerID; - $mysqli->Query("UPDATE $spielID"."_spieler SET lebt = 0 WHERE id = $spielerID"); + $mysqli->Query("UPDATE $spielID"."_spieler SET lebt = 0 WHERE id = $spielerID"); + //Überprüfe, ob sonst schon alle bereit sind + if ($g = gameAssoc($mysqli)) + { + phaseBeendenWennAlleBereit($g['spielphase'],$mysqli); + } } function alleReloadAusser($spielerID,$mysqli)