The suicide sound may play at different speed for different players, that's why the explosion should not depend on the fact if the sound has finished playing or not. --- src/weapon/suicide.cpp | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/weapon/suicide.cpp b/src/weapon/suicide.cpp index 4ed9bc5..c87ce4d 100644 --- a/src/weapon/suicide.cpp +++ b/src/weapon/suicide.cpp @@ -29,6 +29,8 @@ #include "team/teams_list.h" #include "include/action_handler.h" +const uint SUICIDE_SOUND_DURATION_IN_MS = 3600; + Suicide::Suicide() : Weapon(WEAPON_SUICIDE, "suicide", new ExplosiveWeaponConfig()) { UpdateTranslationStrings(); @@ -51,7 +53,7 @@ bool Suicide::p_Shoot() void Suicide::Refresh() { - if(m_last_fire_time > 0 && !suicide_sound.IsPlaying() && !ActiveCharacter().IsDead()) { + if (m_last_fire_time > SUICIDE_SOUND_DURATION_IN_MS && !ActiveCharacter().IsDead()) { ActiveCharacter().DisableDeathExplosion(); ActiveCharacter().body->MakeParticles(ActiveCharacter().GetPosition()); ActiveCharacter().SetEnergy(0); // Die! -- 1.6.0.4 _______________________________________________ Wormux-dev mailing list Wormux-dev@gna.org https://mail.gna.org/listinfo/wormux-dev