From 2db2c88554448e94edfe4dd877981b96aab4fe68 Mon Sep 17 00:00:00 2001 From: kremsy Date: Mon, 14 Apr 2014 19:50:56 +0200 Subject: [PATCH] exception fix --- application/core/Players/PlayerActions.php | 5 +++-- application/core/Players/PlayerList.php | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/application/core/Players/PlayerActions.php b/application/core/Players/PlayerActions.php index b6966c94..d223238b 100644 --- a/application/core/Players/PlayerActions.php +++ b/application/core/Players/PlayerActions.php @@ -192,8 +192,9 @@ class PlayerActions { try { $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch(Exception $e) { - $this->maniaControl->chat->sendException($e, $admin->login); - return; + if($e->getMessage() != "The player is not a spectator"){ + throw $e; + } } } } diff --git a/application/core/Players/PlayerList.php b/application/core/Players/PlayerList.php index 01f66be6..26137246 100644 --- a/application/core/Players/PlayerList.php +++ b/application/core/Players/PlayerList.php @@ -651,7 +651,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $this->maniaControl->client->forceSpectator($adminLogin, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->forceSpectatorTarget($adminLogin, $targetLogin, 1); } catch(Exception $e) { - if($e->getMessage() != "This player is not a spectator."){ + if($e->getMessage() != "The player is not a spectator"){ throw $e; } } @@ -725,7 +725,7 @@ class PlayerList implements ManialinkPageAnswerListener, CallbackListener, Timer $this->maniaControl->client->forceSpectator($target->login, PlayerActions::SPECTATOR_BUT_KEEP_SELECTABLE); $this->maniaControl->client->spectatorReleasePlayerSlot($target->login); } catch(Exception $e) { - if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator.') { + if ($e->getMessage() != 'Login unknown.' && $e->getMessage() != 'The player is not a spectator') { $this->maniaControl->chat->sendException($e); } }