mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
- ensure for all games that deleting a sprite unlinks all sounds from it.
This was only present in Duke but is needed for all games.
This commit is contained in:
parent
f341fbc1fb
commit
668c34d4c1
3 changed files with 10 additions and 0 deletions
|
@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||
#include "m_crc32.h"
|
||||
#include "md4.h"
|
||||
#include "automap.h"
|
||||
#include "raze_sound.h"
|
||||
|
||||
//#include "actor.h"
|
||||
#include "globals.h"
|
||||
|
@ -210,6 +211,9 @@ int qinsertsprite(short nSector, short nStat) // Replace
|
|||
|
||||
int DeleteSprite(int nSprite)
|
||||
{
|
||||
FVector3 pos = GetSoundPos(&sprite[nSprite].pos);
|
||||
soundEngine->RelinkSound(SOURCE_Actor, &sprite[nSprite], nullptr, &pos);
|
||||
|
||||
if (sprite[nSprite].extra > 0)
|
||||
{
|
||||
dbDeleteXSprite(sprite[nSprite].extra);
|
||||
|
|
|
@ -555,6 +555,9 @@ void mydeletesprite(int nSprite)
|
|||
I_Error("bad sprite value %d handed to mydeletesprite", nSprite);
|
||||
}
|
||||
|
||||
FVector3 pos = GetSoundPos(&sprite[nSprite].pos);
|
||||
soundEngine->RelinkSound(SOURCE_Actor, &sprite[nSprite], nullptr, &pos);
|
||||
|
||||
deletesprite(nSprite);
|
||||
|
||||
if (nSprite == besttarget) {
|
||||
|
|
|
@ -799,6 +799,9 @@ KillSprite(int16_t SpriteNum)
|
|||
User[SpriteNum] = 0;
|
||||
}
|
||||
|
||||
FVector3 pos = GetSoundPos(&sprite[SpriteNum].pos);
|
||||
soundEngine->RelinkSound(SOURCE_Actor, &sprite[SpriteNum], nullptr, &pos);
|
||||
|
||||
deletesprite(SpriteNum);
|
||||
// shred your garbage - but not statnum
|
||||
statnum = sp->statnum;
|
||||
|
|
Loading…
Reference in a new issue