custom votes fix

This commit is contained in:
kremsy 2014-02-20 15:25:21 +01:00 committed by Steffen Schröder
parent 7d2e87f077
commit fc6718ae04

View File

@ -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;
}