mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-08 11:13:35 +00:00
Whiteboard: fix the problem of units being unhidden...
...before their movement was finished animating. Fixes bug #16415.
This commit is contained in:
parent
1ac05aef64
commit
eeb5bd07aa
@ -103,12 +103,15 @@ void highlight_visitor::highlight()
|
||||
if (action_ptr main = main_highlight_.lock())
|
||||
{
|
||||
//Hide any "present" unit that gets in the way
|
||||
if (!events::commands_disabled) //< don't do it e.g. during unit movement
|
||||
{
|
||||
unit* hide_me = get_visible_unit(mouseover_hex_,
|
||||
resources::teams->at(side_actions_->team_index()),false);
|
||||
if (hide_me && hide_me->side() == int(side_actions_->team_index()) + 1)
|
||||
{
|
||||
hide_me->set_hidden(true);
|
||||
}
|
||||
}
|
||||
|
||||
//Highlight main highlight
|
||||
mode_ = HIGHLIGHT_MAIN;
|
||||
@ -139,15 +142,20 @@ void highlight_visitor::unhighlight()
|
||||
mode_ = UNHIGHLIGHT;
|
||||
//unhighlight main highlight
|
||||
if (action_ptr main = main_highlight_.lock() )
|
||||
{
|
||||
main->accept(*this);
|
||||
|
||||
//Unhide the other unit in the hex if it was hidden
|
||||
if (!events::commands_disabled) //< don't do it e.g. during unit movement
|
||||
{
|
||||
unit* unhide_me = get_visible_unit(mouseover_hex_,
|
||||
resources::teams->at(side_actions_->team_index()),false);
|
||||
if (unhide_me && unhide_me->side() == int(side_actions_->team_index()) + 1)
|
||||
{
|
||||
unhide_me->set_hidden(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//unhighlight secondary highlights
|
||||
foreach(weak_action_ptr weak, secondary_highlights_)
|
||||
|
Loading…
x
Reference in New Issue
Block a user