From fc6718ae049a1d23e42e7aba7f4733aeef67f446 Mon Sep 17 00:00:00 2001 From: kremsy Date: Thu, 20 Feb 2014 15:25:21 +0100 Subject: [PATCH] custom votes fix --- application/plugins/CustomVotes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/plugins/CustomVotes.php b/application/plugins/CustomVotes.php index c1579d37..1cc66fce 100644 --- a/application/plugins/CustomVotes.php +++ b/application/plugins/CustomVotes.php @@ -437,7 +437,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP * @param Player $player */ public function handlePositiveVote(array $callback, Player $player) { - if ($player->isSpectator && !$this->maniaControl->settingManager->getSetting($this, self::SETTING_SPECTATOR_ALLOW_VOTE)) { + if (!isset($this->currentVote) || $player->isSpectator && !$this->maniaControl->settingManager->getSetting($this, self::SETTING_SPECTATOR_ALLOW_VOTE)) { return; } @@ -451,7 +451,7 @@ class CustomVotesPlugin implements CommandListener, CallbackListener, ManialinkP * @param Player $player */ public function handleNegativeVote(array $callback, Player $player) { - if ($player->isSpectator && !$this->maniaControl->settingManager->getSetting($this, self::SETTING_SPECTATOR_ALLOW_VOTE)) { + if (!isset($this->currentVote) || $player->isSpectator && !$this->maniaControl->settingManager->getSetting($this, self::SETTING_SPECTATOR_ALLOW_VOTE)) { return; }