Skip to content

Commit

Permalink
Refresh team flags after using [modify_side] color= without a new fla…
Browse files Browse the repository at this point in the history
…g set

Fixes bug #21867.
  • Loading branch information
irydacea committed May 16, 2014
1 parent 4f41313 commit 68b5fc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog
Expand Up @@ -4,6 +4,8 @@ Version 1.11.14+dev:
* Miscellaneous and bug fixes:
* Reallow selection of another unit on same side without deselect first
* Fix bug #22042: filesystem content disclosure issue affecting Lua APIs
* Fix bug #21867: team flag colors not refreshed after making use of
[modify_side] color= unless a new flag set is also provided.

Version 1.11.14:
* Campaigns:
Expand Down
7 changes: 6 additions & 1 deletion src/game_events/action_wml.cpp
Expand Up @@ -1275,10 +1275,15 @@ WML_HANDLER_FUNCTION(modify_side, /*event_info*/, cfg)
config::attribute_value flag = cfg["flag"];
if(!flag.empty()) {
teams[team_index].set_flag(flag);
resources::screen->reinit_flags_for_side(team_index);
// Needed especially when map isn't animated.
invalidate_screen = true;
}
// If either the flag set or the team color changed, we need to
// rebuild the team's flag cache to reflect the changes. Note that
// this is not required for flag icons (used by the theme UI only).
if(!color.empty() || !flag.empty()) {
resources::screen->reinit_flags_for_side(team_index);
}
// Change flag icon
config::attribute_value flag_icon = cfg["flag_icon"];
if(!flag_icon.empty()) {
Expand Down

0 comments on commit 68b5fc1

Please sign in to comment.