Author: boucman
Date: Wed May 20 18:33:13 2009
New Revision: 35771
URL: http://svn.gna.org/viewcvs/wesnoth?rev=35771&view=rev
Log:
fix idle anims not finishing correctly
Modified:
trunk/src/display.cpp
trunk/src/display.hpp
trunk/src/unit.hpp
Modified: trunk/src/display.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.cpp?rev=35771&r1=35770&r2=35771&view=diff
==============================================================================
--- trunk/src/display.cpp (original)
+++ trunk/src/display.cpp Wed May 20 18:33:13 2009
@@ -1555,7 +1555,7 @@
return !outside_area(map_area(), x, y);
}
-bool display::tile_nearly_on_screen(const map_location& loc)
+bool display::tile_nearly_on_screen(const map_location& loc) const
{
int x = get_location_x(loc);
int y = get_location_y(loc);
Modified: trunk/src/display.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/display.hpp?rev=35771&r1=35770&r2=35771&view=diff
==============================================================================
--- trunk/src/display.hpp (original)
+++ trunk/src/display.hpp Wed May 20 18:33:13 2009
@@ -446,7 +446,7 @@
bool tile_fully_on_screen(const map_location& loc);
/** Checks if location @a loc or one of the adjacent tiles is visible
on screen. */
- bool tile_nearly_on_screen(const map_location &loc);
+ bool tile_nearly_on_screen(const map_location &loc) const;
/**
* Draws invalidated items.
Modified: trunk/src/unit.hpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/unit.hpp?rev=35771&r1=35770&r2=35771&view=diff
==============================================================================
--- trunk/src/unit.hpp (original)
+++ trunk/src/unit.hpp Wed May 20 18:33:13 2009
@@ -146,12 +146,15 @@
void new_scenario();
/** Called on every draw */
void refresh(const game_display& disp,const map_location& loc) {
- if (state_ != STATE_STANDING || get_current_animation_tick() <
next_idling_ || incapacitated())
- return;
if (state_ == STATE_FORGET && anim_ &&
anim_->animation_finished_potential()) {
set_standing(loc);
return;
}
+ if (state_ != STATE_STANDING ||
+ get_current_animation_tick() < next_idling_ ||
+ !disp.tile_nearly_on_screen(loc) ||
+ incapacitated())
+ return;
if (get_current_animation_tick() > next_idling_ + 1000) {
// prevent all units animating at the same time
if (disp.idle_anim()) {
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits