Browse Source

Adds check so we only do the pausing of the audio/sim when opening the pause menu when it's single player

Areloch 4 years ago
parent
commit
d83fc0b232
1 changed files with 11 additions and 4 deletions
  1. 11 4
      Templates/BaseGame/game/data/ui/guis/pauseMenu.cs

+ 11 - 4
Templates/BaseGame/game/data/ui/guis/pauseMenu.cs

@@ -7,9 +7,13 @@ function PauseMenuList::onAdd(%this)
 
 function PauseMenu::onWake(%this)
 {
-   $timescale = 0;
+   if($Server::ServerType $= "SinglePlayer")
+   {
+      $timescale = 0;
+      
+      sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ 0 ] );
+   }
    
-   sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ 0 ] );
    PauseMenuList.hidden = false;
    PauseMenuList.setFirstResponder();
    PauseButtonHolder.setActive();
@@ -18,8 +22,11 @@ function PauseMenu::onWake(%this)
 
 function PauseMenu::onSleep(%this)
 {
-   $timescale = 1;
-   sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
+   if($Server::ServerType $= "SinglePlayer")
+   {
+      $timescale = 1;
+      sfxSetChannelVolume( $SimAudioType, $pref::SFX::channelVolume[ $SimAudioType ] );
+   }
 }
 
 function PauseMenu::onReturnTo(%this)