added try-catch to prevent crash in modes without the setting
This commit is contained in:
parent
ffd2387591
commit
7d9c1b5fde
@ -139,17 +139,17 @@ class DynamicPointLimitPlugin implements CallbackListener, CommandListener, Plug
|
|||||||
}
|
}
|
||||||
$pointLimit = (int)$pointLimit;
|
$pointLimit = (int)$pointLimit;
|
||||||
|
|
||||||
if ($this->lastPointLimit != $pointLimit) {
|
if ($this->lastPointLimit !== $pointLimit) {
|
||||||
$newSettings = array('S_MapPointsLimit' => $pointLimit);
|
try {
|
||||||
$this->maniaControl->client->setModeScriptSettings($newSettings);
|
$this->maniaControl->client->setModeScriptSettings(array('S_MapPointsLimit' => $pointLimit));
|
||||||
|
$message = "Dynamic PointLimit changed to: {$pointLimit}!";
|
||||||
$message = "Dynamic PointLimit changed to: {$pointLimit}!";
|
if ($this->lastPointLimit !== null) {
|
||||||
if ($this->lastPointLimit !== null) {
|
$message .= " (From {$this->lastPointLimit})";
|
||||||
$message .= " (From {$this->lastPointLimit})";
|
}
|
||||||
|
$this->maniaControl->chat->sendInformation($message);
|
||||||
|
$this->lastPointLimit = $pointLimit;
|
||||||
|
} catch (GameModeException $exception) {
|
||||||
}
|
}
|
||||||
$this->maniaControl->chat->sendChat($message);
|
|
||||||
|
|
||||||
$this->lastPointLimit = $pointLimit;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user