Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refresh team flags after using [modify_side] color= without a new fla…

…g set

Fixes bug #21867.
  • Loading branch information...
commit 68b5fc18843537951446900dee710724b33bcabd 1 parent 4f41313
@shikadilord shikadilord authored
Showing with 8 additions and 1 deletion.
  1. +2 −0  changelog
  2. +6 −1 src/game_events/action_wml.cpp
View
2  changelog
@@ -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:
View
7 src/game_events/action_wml.cpp
@@ -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()) {

0 comments on commit 68b5fc1

Please sign in to comment.
Something went wrong with that request. Please try again.