This commit is contained in:
ln-zookeeper 2014-02-11 10:36:00 +02:00
commit 89b11108e5
2 changed files with 15 additions and 0 deletions

View file

@ -10,6 +10,9 @@ Version 1.11.9+dev:
* Added: A new tooltip window.
* Language and i18n:
* Updated translations:
* WML engine:
* Implemented [true] and [false] ConditionalWML tags, which describe a
condition that always yields true or false, respectively.
* Miscellaneous and bug fixes:
* Fixed: A compilation warning with DEBUG_WINDOW_LAYOUT_GRAPHS.

View file

@ -47,6 +47,18 @@ namespace { // Support functions
bool internal_conditional_passed(const vconfig& cond, bool& backwards_compat)
{
const vconfig::child_list& true_keyword = cond.get_children("true");
backwards_compat = backwards_compat && true_keyword.empty();
if(!true_keyword.empty()) {
return true;
}
const vconfig::child_list& false_keyword = cond.get_children("false");
backwards_compat = backwards_compat && false_keyword.empty();
if(!false_keyword.empty()) {
return false;
}
static std::vector<std::pair<int,int> > default_counts = utils::parse_ranges("1-99999");
// If the if statement requires we have a certain unit,