introduce [redraw]clear_shroud=(def no), [redraw]<SSF>

(fix for bug #18879)

There was an implicit conversion config::attribute_value to int with
default 0. Strangely, this sometimes went well with my MinGw built and
also does for some time in Espreon's backtrace, but MSVC crashes early
where the resulting out-of-bounds problem occurs (actions.cpp:2366)
This commit is contained in:
Anonymissimus 2011-11-04 21:13:55 +00:00
parent c37872bde6
commit 96c1152c23

View file

@ -2380,9 +2380,19 @@ WML_HANDLER_FUNCTION(redraw, /*event_info*/, cfg)
{
game_display &screen = *resources::screen;
config::attribute_value side = cfg["side"];
if (!side.empty()) {
clear_shroud(side);
const config::attribute_value clear_shroud_av = cfg["clear_shroud"];
const config::attribute_value side = cfg["side"];
bool clear_shroud_bool = clear_shroud_av.to_bool(false);
if(clear_shroud_av.blank() && !side.blank()) {
//Backwards compat, behavior of the tag was to clear shroud in case that side= is given.
clear_shroud_bool = true;
}
if (clear_shroud_bool) {
side_filter filter(cfg);
foreach(const int side, filter.get_teams()){
clear_shroud(side);
}
screen.recalculate_minimap();
}
if (screen_needs_rebuild) {