Nasty fix for MP3 gamemodes
This commit is contained in:
		
				
					committed by
					
						 Steffen Schröder
						Steffen Schröder
					
				
			
			
				
	
			
			
			
						parent
						
							bb4a3e3eef
						
					
				
				
					commit
					6a92553e75
				
			| @@ -470,7 +470,7 @@ class Dedimania implements CallbackListener, TimerListener, Plugin { | ||||
| 		$playerInfo = $this->getPlayerList(); | ||||
| 		$mapInfo    = $this->getMapInfo(); | ||||
| 		$gameMode   = $this->getGameModeString(); | ||||
|  | ||||
| 		 | ||||
| 		if (!$serverInfo || !$playerInfo || !$mapInfo || !$gameMode) { | ||||
| 			return false; | ||||
| 		} | ||||
| @@ -802,11 +802,17 @@ class Dedimania implements CallbackListener, TimerListener, Plugin { | ||||
| 	 */ | ||||
| 	private function getGameModeString() { | ||||
| 		$gameMode = $this->maniaControl->server->getGameMode(); | ||||
| 		$scriptName = str_replace('.Script.txt', '', $this->maniaControl->client->getScriptName()["CurrentValue"]); | ||||
| 		if ($gameMode === null) { | ||||
| 			trigger_error("Couldn't retrieve game mode. "); | ||||
| 			return null; | ||||
| 		} | ||||
| 		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 3: | ||||
| 			case 5: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user