From 94ce9f7d2870c3d428869399b8f8b06b20d0acd4 Mon Sep 17 00:00:00 2001 From: Serge Martin Date: Thu, 21 Sep 2006 20:45:10 +0000 Subject: [PATCH] re add anim_->update_current_frame(); in unit.cpp to fix infinite loop with sliver mage teleport --- src/unit.cpp | 1 + src/unit_display.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/unit.cpp b/src/unit.cpp index 63fe1b468f1..7487fb97310 100644 --- a/src/unit.cpp +++ b/src/unit.cpp @@ -1854,6 +1854,7 @@ void unit::redraw_unit(display& disp,gamemap::location hex) std::string image_name; unit_frame current_frame; + anim_->update_current_frame(); if(anim_->animation_finished()) current_frame = anim_->get_last_frame(); else if(anim_->get_first_frame_time() > anim_->get_animation_time()) current_frame = anim_->get_first_frame(); else current_frame = anim_->get_current_frame(); diff --git a/src/unit_display.cpp b/src/unit_display.cpp index 0a05cb7b950..f1b779491e0 100644 --- a/src/unit_display.cpp +++ b/src/unit_display.cpp @@ -303,8 +303,8 @@ bool unit_attack_ranged(display& disp, unit_map& units, halo::remove(missile_frame_halo); missile_halo = 0; missile_frame_halo = 0; - if(animation_time > missile_animation.get_first_frame_time() && - animation_time < missile_animation.get_last_frame_time() && + if(animation_time > missile_animation.get_first_frame_time() && + animation_time < missile_animation.get_last_frame_time() && (!disp.fogged(b.x,b.y) || !disp.fogged(a.x,a.y))) { const int posx = int(pos*xdst + (1.0-pos)*xsrc); const int posy = int(pos*ydst + (1.0-pos)*ysrc); @@ -389,7 +389,7 @@ bool unit_attack_ranged(display& disp, unit_map& units, bool unit_attack(display& disp, unit_map& units, const gamemap::location& a, const gamemap::location& b, int damage, - const attack_type& attack, const attack_type* secondary_attack, + const attack_type& attack, const attack_type* secondary_attack, bool update_display, int swing) { const bool hide = disp.update_locked() || disp.fogged(a.x,a.y) && disp.fogged(b.x,b.y)