div by zero fix

This commit is contained in:
Steffen Schröder 2014-03-19 10:46:14 +01:00
parent 121ba2ed9b
commit 26c9024537

View File

@ -130,7 +130,7 @@ class EndurancePlugin implements CallbackListener, Plugin {
*/
public function callback_Checkpoint(array $callback) {
$callbackData = json_decode($callback[1]);
if ($callbackData->Checkpoint % $this->currentMap->nbCheckpoints != 0) {
if (!$this->currentMap->nbCheckpoints || $callbackData->Checkpoint % $this->currentMap->nbCheckpoints != 0) {
return;
}
$player = $this->maniaControl->playerManager->getPlayer($callbackData->Login);