From a68e81086b86dee17629918bcdd4e3dc70f1bb0c Mon Sep 17 00:00:00 2001 From: Wanne Date: Mon, 9 Jan 2012 10:40:47 +0000 Subject: [PATCH] - Bugfix: Allow the game to use 0 KB files for faking missing WAV speeches git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4879 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Standard Gaming Platform/soundman.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Standard Gaming Platform/soundman.cpp b/Standard Gaming Platform/soundman.cpp index 6063906d..8e63f956 100644 --- a/Standard Gaming Platform/soundman.cpp +++ b/Standard Gaming Platform/soundman.cpp @@ -339,12 +339,17 @@ UINT32 SoundPlayStreamedFile( STR pFilename, SOUNDPARMS *pParms ) { hFile = FileOpen( pFilename, FILE_ACCESS_READ | FILE_OPEN_EXISTING, FALSE ); if( !hFile ) - { + { SoundLog((CHAR8 *)String(" ERROR in SoundPlayStreamedFile(): Couldnt open '%s'", pFilename ) ); return( SOUND_ERROR ); } + UINT32 uiSize = FileGetSize(hFile); FileClose(hFile); + + if (uiSize == 0) + return ( NO_SAMPLE); + return(SoundStartStream( pFilename, uiChannel, pParms)); } }