Malformed data caused config::error exception to be thrown.
Unfortunately campaignd on catching such an exception had no way to
close the right connection, instead all connections were closed because
the local variable that was supposed to contain connection number wasn't
updated. This is fixed by using boost.exception to attach the necessary
data to config::error objects so it can be used at the catch site.
...of config::attribute_value & to tstring & or t_token reference
causes crashes. Some compilers were generating a temporary object and
binding a reference to the temporary when creating an implicit cast to
an attribute value. I removed the implicit cast and replaced all (I
think) instances of the implicit cast with explicit 2 step operation.
This fixes bugs like bug #18663, bug #18684
1. Added a child_range_index member function to config to generate an index
2. Changed the load dialog from the O(N^2) search for saved games to a
O(N) listing.
...t_token in place of std::string. t_token compares, copies, copy
constructs and hashes in 1 operation instead of proportional to the
length of the string.
...to return translatable strings after variable expansion.
In particular, the engine no longer tries to expand variables inside
plain numbers or booleans.
Optimized string escaping.
Fixed strange indentation of embedded textdomain changes.
Reduced amount of useless quotes and spaces.
This patch brings the time needed for outputting the cache for the
test scenario from 17% of the total time down to negligible.
Ideally, a bool operator would have been added to attribute_value
instead of adding yet another accessor to config.
But it can't work for now:
- conversion to a safe bool would lose against the conversion to int;
- conversion to plain bool would conflict with the conversion to int.
So we are stuck with using a pointer to emulate an option type.
...smaller effective types when they are not translatable.
This patch considerably reduces the memory footprint of WML and speeds it up.
It should not change any WML behavior, except for a few corner cases
detailled below:
- "off" is no longer a synonym for "no" (it wasn't used anyway),
- _"42" is no longer an integer,
- untranslatable "true" and "false" are stored as booleans, hence
displayed as "yes" and "no",
- "042" is now understood as octal notation (hence 34) rather than decimal,
- hexadecimal notation "0x42" is now recognized.