DEADSOFTWARE

Fast fix nil Sound on damned.wad MAP11
authorDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 17 May 2018 20:51:32 +0000 (23:51 +0300)
committerDeaDDooMER <deaddoomer@deadsoftware.ru>
Thu, 17 May 2018 20:52:46 +0000 (23:52 +0300)
src/game/g_netmsg.pas

index b98681b1c42dd705a623edf16a4cb2d1f280b76c..f17c0ed40a2c1c4742b0cea5499117a52abc7d1c 100644 (file)
@@ -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;