Improve readability by adding appropriate parentheses and braces, and fixing misleading/confusing whitespace. Extract SolidMask removal to a function since it's used in several places.
Previously, the error message was only silenced for openclonk-server,
but appeared for openclonk if compiled without sounds.
Possible side effect: no local sounds will play if the global Sound.ocg
cannot be loaded. I don't think this is something we should support.
The old LineFeed constant caused problems with Qt. Using \n directly is
easier and I don't think there's a reason left to use \r\n anyways.
We've always converted the files in the repository. Nowadays, even
notepad.exe works with unix file endings.
The parser was only checking that the passed setting matched the
beginning of the expected keyword, instead of checking for the full
length. This way, users could write "#warning e" instead of the
expected "#warning enable" and still have it work.
When no parameter followed the "#warning" pragma, because the end
iterator would be located before the begin iterator, basic_string's
constructor would throw std::length_error. Check for this case
beforehand so we can throw the expected C4ParseError instead.
Switching to random teams would remove all teams but the first two on
the host, but not on the clients. With this fix, the extra teams are
removed on the clients as well. This fixes a desync when using
GetTeamCount() in a sync-relevant way.
operator void* is a quick and dirty workaround for the lack of
explicit operator bool in old C++ standards. Since we can use
explicit operator bool now, we don't need the operator void*
anymore.
Incidentally, that operator also allowed C4Set to equality compare
C4Property entries, which is unintuitive. Replace it with an
explicit specialization of C4Set::Equals.
C4Set used to set its removed elements to nullptr. This requires
some special handling from non-pointer entries like C4Property.
Overwriting the element with a zero-initialized one removes this
requirement, leading to improved type safety on the part of
C4Property.
CMake before 3.7 didn't properly pass the standard selection flags
to try_compile. Wrap try_compile on old CMake versions so that the
flag gets passed.
The C++ standard doesn't require us to stuff multiple statements
onto the same line, so we should avoid this for readability reasons.
This is especially true if one of the statements is controlled and
others aren't.
Some code here was indented like it still belonged to the loop
above, but never did, and was never intended to. This is an
excellent argument for why braces are good, especially for
statements which span more than one line.
We're not using the <locale.h> header anywhere besides including it
for no purpose, so we can drop the test (and the inclusion).
Additionally, the header is part of standard C++.
CMake 3.5.1 is the version that ships with Ubuntu 16.04 LTS. Ubuntu
14.04 LTS was already unsupported by our build, so we don't need to
worry about that.
Not sure about air pipes yet, those should theoretically be either
source or drain, instead of a separate connection category?
See also:
https://bugs.openclonk.org/view.php?id=1871
The library did not depend on the Library_LiquidContainer script at all,
removed that include and added it to the previous includers.
Removed the IsLiquidTank() identifier, because it was unused.
Smoke used to fly higher with gravity 40 than with gravity 10. Fixed
this by using a start value. At default gravity, light smoke will fly
rise a little higher now, and heavy smoke behaves the same.
With higher gravity the smoke may fall to the ground now.