diff --git a/Classic/scripts/autoexec/VoteMenu.cs b/Classic/scripts/autoexec/VoteMenu.cs index 2be5859..608f405 100644 --- a/Classic/scripts/autoexec/VoteMenu.cs +++ b/Classic/scripts/autoexec/VoteMenu.cs @@ -323,6 +323,8 @@ function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, % { if(%arg1 $= "999") %time = "unlimited"; else %time = %arg1; %msg = %client.nameBase @ " initiated a vote to change the time limit to " @ %time @ "."; + // VoteOvertime + StartVOTimeVote(%game); } case "VoteMatchStart": @@ -783,9 +785,17 @@ function DefaultGame::voteChangeTimeLimit( %game, %admin, %newLimit ) { messageAll('MsgVotePassed', '\c2The mission time limit was set to %1 minutes by vote.', %display); $Host::TimeLimit = %newLimit; + // VoteOvertime + ResetVOTimeChanged(%game); + // Reset the voted time limit when changing mission + $TimeLimitChanged = 1; } else - messageAll('MsgVoteFailed', '\c2The vote to change the mission time limit did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100)); + { + messageAll('MsgVoteFailed', '\c2The vote to change the mission time limit did not pass: %1 percent.', mFloor(%game.totalVotesFor/(ClientGroup.getCount() - $HostGameBotCount - %game.totalVotesNone) * 100)); + // VoteOvertime + ResetVOall(%game); + } } //if the match has been started, reset the end of match countdown @@ -1094,7 +1104,8 @@ function DefaultGame::passRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4) function DefaultGame::stopRunningVote(%game, %admin, %arg1, %arg2, %arg3, %arg4) { - if(%admin && Game.scheduleVote !$= "") + %curTimeLeftMS = ($Host::TimeLimit * 60 * 1000) + $missionStartTime - getSimTime(); + if(%admin && Game.scheduleVote !$= "" && %curTimeLeftMS > 0) { stopCurrentVote(); messageAll('MsgAdminForce', '\c2The Admin stopped the vote.'); diff --git a/Classic/scripts/autoexec/VoteOverTime.cs b/Classic/scripts/autoexec/VoteOverTime.cs index 6e6ce4e..87a52c8 100644 --- a/Classic/scripts/autoexec/VoteOverTime.cs +++ b/Classic/scripts/autoexec/VoteOverTime.cs @@ -68,9 +68,6 @@ function DefaultGame::gameOver(%game) //Reset everything to do with Vote Overtime ResetVOall(%game); - - if(isEventPending($VoteSoundSchedule)) - cancel($VoteSoundSchedule); } };