From: DeaDDooMER Date: Thu, 17 May 2018 20:51:32 +0000 (+0300) Subject: Fast fix nil Sound on damned.wad MAP11 X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=commitdiff_plain;h=bd64003336a7e3bb6fb8b3fd93d4ed2c7bc13f3b Fast fix nil Sound on damned.wad MAP11 --- diff --git a/src/game/g_netmsg.pas b/src/game/g_netmsg.pas index b98681b..f17c0ed 100644 --- a/src/game/g_netmsg.pas +++ b/src/game/g_netmsg.pas @@ -2456,16 +2456,19 @@ begin if gTriggers[I].ClientID = SID then with gTriggers[I] do begin - if SPlaying then + if Sound <> nil then begin - if tgcLocal then - Sound.PlayVolumeAt(X+(Width div 2), Y+(Height div 2), tgcVolume/255.0) + if SPlaying then + begin + if tgcLocal then + Sound.PlayVolumeAt(X+(Width div 2), Y+(Height div 2), tgcVolume/255.0) + else + Sound.PlayPanVolume((tgcPan-127.0)/128.0, tgcVolume/255.0); + Sound.SetPosition(SPos); + end else - Sound.PlayPanVolume((tgcPan-127.0)/128.0, tgcVolume/255.0); - Sound.SetPosition(SPos); - end - else - if Sound.IsPlaying then Sound.Stop; + if Sound.IsPlaying then Sound.Stop; + end; SoundPlayCount := SCount; end;