From 615010e82421384df3870db91a57959e5ec68a7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20Schro=CC=88der?= Date: Tue, 27 May 2014 11:45:17 +0200 Subject: [PATCH] fix & improvement of dynamic point limit command --- application/plugins/MCTeam/DynamicPointLimitPlugin.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/application/plugins/MCTeam/DynamicPointLimitPlugin.php b/application/plugins/MCTeam/DynamicPointLimitPlugin.php index 5172a73e..01e24ac0 100644 --- a/application/plugins/MCTeam/DynamicPointLimitPlugin.php +++ b/application/plugins/MCTeam/DynamicPointLimitPlugin.php @@ -161,7 +161,7 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug */ public function commandSetPointlimit(array $chatCallback, Player $player) { $commandParts = explode(' ', $chatCallback[1][2]); - if ($commandParts < 2) { + if (count($commandParts) < 2) { $this->maniaControl->chat->sendUsageInfo('Example: //setpointlimit auto', $player); return; } @@ -179,10 +179,14 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug } try { $this->maniaControl->client->setModeScriptSettings(array('S_MapPointsLimit' => $value)); - $this->staticMode = true; + $this->staticMode = true; + $this->lastPointLimit = $value; $this->maniaControl->chat->sendInformation("PointLimit changed to: {$value} (Fixed)"); - } catch (GameModeException $e) { + } catch (GameModeException $exception) { + $this->maniaControl->chat->sendException($exception, $player); } + } else { + $this->maniaControl->chat->sendUsageInfo('Example: //setpointlimit 150', $player); } } }