From bcb729ff232da6cfb679e5dc1370bac2f4b75c82 Mon Sep 17 00:00:00 2001 From: Justin Jacobs Date: Tue, 18 Dec 2012 15:32:39 -0500 Subject: [PATCH] Raise the death_penalty flag at the proper time --- src/Avatar.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Avatar.cpp b/src/Avatar.cpp index 79bfa7dc2..1ed7504aa 100644 --- a/src/Avatar.cpp +++ b/src/Avatar.cpp @@ -622,6 +622,10 @@ void Avatar::logic(int actionbar_power, bool restrictPowerUse) { if (activeAnimation->isFirstFrame() && activeAnimation->getTimesPlayed() < 1) { stats.effects.clearEffects(); + + // raise the death penalty flag. Another module will read this and reset. + stats.death_penalty = true; + if (sound_die) Mix_PlayChannel(-1, sound_die, 0); if (stats.permadeath) { @@ -789,9 +793,6 @@ bool Avatar::takeHit(const Hazard &h) { if (stats.hp <= 0) { stats.effects.triggered_death = true; stats.cur_state = AVATAR_DEAD; - - // raise the death penalty flag. Another module will read this and reset. - stats.death_penalty = true; } else if (prev_hp > stats.hp) { // only interrupt if damage was taken if (sound_hit)