Florian Köberle a écrit :
> 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.
>
Maybe a comment in the code is needed to explain that. This is not
obvious ;)
> ---
> 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!
>
_______________________________________________
Wormux-dev mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-dev