Nasty fix for MP3 gamemodes

This commit is contained in:
Max Klaversma 2014-03-26 22:38:50 +01:00 committed by Steffen Schröder
parent bb4a3e3eef
commit 6a92553e75

View File

@ -802,11 +802,17 @@ class Dedimania implements CallbackListener, TimerListener, Plugin {
*/ */
private function getGameModeString() { private function getGameModeString() {
$gameMode = $this->maniaControl->server->getGameMode(); $gameMode = $this->maniaControl->server->getGameMode();
$scriptName = str_replace('.Script.txt', '', $this->maniaControl->client->getScriptName()["CurrentValue"]);
if ($gameMode === null) { if ($gameMode === null) {
trigger_error("Couldn't retrieve game mode. "); trigger_error("Couldn't retrieve game mode. ");
return null; return null;
} }
switch($gameMode) { switch($gameMode) {
case 0:
{
if($scriptName == 'Rounds' || $scriptName == 'Cup' || $scriptName == 'Team') { return 'Rounds'; }
else if($scriptName == 'TimeAttack' || $scriptName == 'Laps' || $scriptName == 'TeamAttack'){ return 'TA'; }
}
case 1: case 1:
case 3: case 3:
case 5: case 5: