Removed redundant parameters from unit::set_selecting.

This commit is contained in:
Guillaume Melquiond 2009-05-21 14:57:40 +00:00
parent adfd170240
commit 0dd288275e
3 changed files with 8 additions and 5 deletions

View File

@ -471,7 +471,7 @@ void mouse_handler::select_hex(const map_location& hex, const bool browse) {
// selection have impact only if we are not observing and it's our unit
if (!browse && !commands_disabled && u->second.side() == gui().viewing_side()) {
sound::play_UI_sound("select-unit.wav");
u->second.set_selecting(gui(), u->first);
u->second.set_selecting();
game_events::fire("select", hex);
}

View File

@ -1812,12 +1812,15 @@ void unit::set_idling(const game_display &disp,const map_location& loc)
start_animation(INT_MAX,loc,choose_animation(disp,loc,"idling"),true,false,"",0,STATE_FORGET);
}
void unit::set_selecting(const game_display &disp,const map_location& loc)
void unit::set_selecting()
{
const game_display *disp = game_display::get_singleton();
if (preferences::show_standing_animations()) {
start_animation(INT_MAX,loc,choose_animation(disp,loc,"selected"),true,false,"",0,STATE_FORGET);
start_animation(INT_MAX, loc_, choose_animation(*disp, loc_, "selected"),
true, false, "", 0, STATE_FORGET);
} else {
start_animation(INT_MAX,loc,choose_animation(disp,loc,"_disabled_selected_"),true,false,"",0,STATE_FORGET);
start_animation(INT_MAX, loc_, choose_animation(*disp, loc_, "_disabled_selected_"),
true, false, "", 0, STATE_FORGET);
}
}

View File

@ -210,7 +210,7 @@ public:
{ set_standing(loc_, with_bars); }
void set_idling(const game_display& disp,const map_location& loc);
void set_selecting(const game_display& disp,const map_location& loc);
void set_selecting();
unit_animation* get_animation() { return anim_;};
const unit_animation* get_animation() const { return anim_;};
void set_facing(map_location::DIRECTION dir);