Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

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 eb931a5ea373bf164e68dd2d270d74d888fc93c5 1 parent 9f458d1
@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
@@ -147,6 +147,8 @@ Version 1.13.0-dev:
that. For example --log-strict=warning causes both warnings and errors
to generate runtime exceptions. This is intended for unit tests.
* 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.11:
* Add-ons server:
View
7 src/game_events/action_wml.cpp
@@ -1316,10 +1316,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()) {
Please sign in to comment.
Something went wrong with that request. Please try again.