DEADSOFTWARE

fixed two warnings in headless mode
[d2df-sdl.git] / src / game / g_sound.pas
index ebce17eb3da8bd509dc7c31ef2e4c850ccbee0e2..b37cd1f896219f277f714e6e372104794a508ede 100644 (file)
@@ -24,7 +24,7 @@ type
     function SetByName(SN: String): Boolean;
     function SetCoords(X, Y: Integer; Volume: Single): Boolean;
 
-    property Loop: Boolean read FLoop write FLoop;
+    property Loop: Boolean read FMusic write FMusic;
     property Name: String read FName;
   end;
 
@@ -304,19 +304,21 @@ begin
         FreeMem(SoundData);
     end
   else
-    e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+  begin
+    //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+  end;
 
   WAD.Free();
-
-  if not ok then
+  if (not ok) then
   begin
+{$IFNDEF HEADLESS}
     if isMusic then
       e_WriteLog(Format('Error loading music %s', [Resource]), MSG_WARNING)
     else
       e_WriteLog(Format('Error loading sound %s', [Resource]), MSG_WARNING);
     Exit;
+{$ENDIF}
   end;
-
   Result := True;
 end;
 
@@ -352,19 +354,21 @@ begin
         FreeMem(SoundData);
     end
   else
-    e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+  begin
+    //e_WriteLog(Format('WAD Reader error: %s', [WAD.GetLastErrorStr]), MSG_WARNING);
+  end;
 
   WAD.Free();
-
-  if not ok then
+  if (not ok) then
   begin
+{$IFNDEF HEADLESS}
     if isMusic then
       e_WriteLog(Format('Error loading music %s', [Resource]), MSG_WARNING)
     else
       e_WriteLog(Format('Error loading sound %s', [Resource]), MSG_WARNING);
     Exit;
+{$ENDIF}
   end;
-
   Result := True;
 end;