1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Fix sound for ennemies on trap

This commit is contained in:
Mathieu Schroeter 2022-10-31 22:11:37 +01:00
parent df94bc86e4
commit 77c0a6ee3b
No known key found for this signature in database
GPG Key ID: 8B9145A5FA9DA8A8
2 changed files with 13 additions and 8 deletions

View File

@ -197,10 +197,10 @@ CDecor::BlupiDelete (Point cel, Sint32 perso)
// Supprime un blupi existant.
void
CDecor::BlupiDelete (Sint32 rank)
CDecor::BlupiDelete (Sint32 rank, SDL_bool haveSound)
{
m_blupi[rank].bExist = false;
this->m_pSound->StopSound (false, rank);
this->m_pSound->StopSound (!haveSound, rank);
if (
!m_bBuild && // phase de jeu ?
@ -2847,9 +2847,10 @@ CDecor::BlupiNextGoal (Sint32 rank)
}
if (channel == CHOBJECT && icon == 93) // piège ?
{
this->m_pSound->StopSound (true, rank);
BlupiSound (rank, SOUND_TRAP, pos);
PutObject (cel, CHOBJECT, 96); // araignée piégée
BlupiDelete (rank); // supprime araignée
BlupiDelete (rank, SDL_TRUE); // supprime araignée
return;
}
}
@ -2944,9 +2945,10 @@ CDecor::BlupiNextGoal (Sint32 rank)
}
if (icon == 93) // piège ?
{
this->m_pSound->StopSound (true, rank);
BlupiSound (rank, SOUND_TRAP, pos);
PutObject (cel, CHOBJECT, 97); // tracks piégé
BlupiDelete (rank); // supprime tracks
BlupiDelete (rank, SDL_TRUE); // supprime tracks
return;
}
@ -3024,9 +3026,10 @@ CDecor::BlupiNextGoal (Sint32 rank)
}
if (icon == 93) // piège ?
{
this->m_pSound->StopSound (true, rank);
BlupiSound (rank, SOUND_TRAP, pos);
PutObject (cel, CHOBJECT, 98); // robot piégé
BlupiDelete (rank); // supprime robot
BlupiDelete (rank, SDL_TRUE); // supprime robot
return;
}
@ -3070,9 +3073,10 @@ CDecor::BlupiNextGoal (Sint32 rank)
GetObject (cel, channel, icon);
if (channel == CHOBJECT && icon == 93) // piège ?
{
this->m_pSound->StopSound (true, rank);
BlupiSound (rank, SOUND_TRAP, pos);
PutObject (cel, CHOBJECT, 114); // bombe piégée
BlupiDelete (rank); // supprime bombe
BlupiDelete (rank, SDL_TRUE); // supprime bombe
return;
}
}
@ -3114,9 +3118,10 @@ CDecor::BlupiNextGoal (Sint32 rank)
GetObject (cel, channel, icon);
if (channel == CHOBJECT && icon == 93) // piège ?
{
this->m_pSound->StopSound (true, rank);
BlupiSound (rank, SOUND_TRAP, pos);
PutObject (cel, CHOBJECT, 19); // électro piégée
BlupiDelete (rank); // supprime électro
BlupiDelete (rank, SDL_TRUE); // supprime électro
return;
}
}

View File

@ -262,7 +262,7 @@ public:
Sint32 BlupiCreate (
Point cel, Sint32 action, Sint32 direct, Sint32 perso, Sint32 energy);
bool BlupiDelete (Point cel, Sint32 perso = -1);
void BlupiDelete (Sint32 rank);
void BlupiDelete (Sint32 rank, SDL_bool haveSound = SDL_FALSE);
void BlupiKill (Sint32 exRank, Point cel, Sint32 type);
bool BlupiIfExist (Sint32 rank);
void BlupiCheat (Sint32 cheat);