mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Accept sounds for dragging a body in other formats than .ogg
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8851 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -11708,6 +11708,7 @@ void SOLDIERTYPE::MoveMerc( FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckR
|
|||||||
// sevenfm: play sound while dragging
|
// sevenfm: play sound while dragging
|
||||||
if (!(this->usSoldierFlagMask2 & SOLDIER_DRAG_SOUND))
|
if (!(this->usSoldierFlagMask2 & SOLDIER_DRAG_SOUND))
|
||||||
{
|
{
|
||||||
|
SGPFILENAME zFilename_Used;
|
||||||
CHAR8 zFilename[512];
|
CHAR8 zFilename[512];
|
||||||
// prepare drag sound
|
// prepare drag sound
|
||||||
if (gsDragSoundNum < 0)
|
if (gsDragSoundNum < 0)
|
||||||
@@ -11716,16 +11717,17 @@ void SOLDIERTYPE::MoveMerc( FLOAT dMovementChange, FLOAT dAngle, BOOLEAN fCheckR
|
|||||||
do
|
do
|
||||||
{
|
{
|
||||||
gsDragSoundNum++;
|
gsDragSoundNum++;
|
||||||
sprintf(zFilename, "Sounds\\Misc\\DragBody%d.ogg", gsDragSoundNum);
|
sprintf(zFilename, "Sounds\\Misc\\DragBody%d", gsDragSoundNum);
|
||||||
} while (FileExists(zFilename));
|
} while ( SoundFileExists( zFilename, zFilename_Used ) );
|
||||||
gsDragSoundNum--;
|
gsDragSoundNum--;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gsDragSoundNum > 0)
|
if (gsDragSoundNum > 0)
|
||||||
{
|
{
|
||||||
sprintf(zFilename, "Sounds\\Misc\\DragBody%d.ogg", Random(gsDragSoundNum) + 1);
|
sprintf(zFilename, "Sounds\\Misc\\DragBody%d", Random(gsDragSoundNum) + 1);
|
||||||
if (FileExists(zFilename))
|
if ( SoundFileExists( zFilename, zFilename_Used ) )
|
||||||
{
|
{
|
||||||
PlayJA2SampleFromFile(zFilename, RATE_11025, SoundVolume(MIDVOLUME, this->sGridNo), 1, SoundDir(this->sGridNo));
|
PlayJA2SampleFromFile( zFilename_Used, RATE_11025, SoundVolume(MIDVOLUME, this->sGridNo), 1, SoundDir(this->sGridNo));
|
||||||
}
|
}
|
||||||
|
|
||||||
this->usSoldierFlagMask2 |= SOLDIER_DRAG_SOUND;
|
this->usSoldierFlagMask2 |= SOLDIER_DRAG_SOUND;
|
||||||
|
|||||||
Reference in New Issue
Block a user