The old query was:
* Selecting data from 2 months ago instead of 1 month ago for some reason, presumably left over from when I was testing the query out for different time periods.
* Counting non-new players who used a new download source as new players.
The last uses of this were removed in 0fbc12ea01986bc97ef6426e0edc89f12224a0d5.
The only uses of the other fixed-point functions from math.hpp are in
src/sdl/utils.cpp. That should probably move to using color.hpp instead,
but this commit is just to solve the -Wshorten-64-to-32 warning.
When we try to trigger an event conditioned by the use of a special whose activity is subject to a condition, we cannot use special_active because the specials are always considered inactive. Additionally, abilities used as weapons possessed or taught by a leadership are also not detectable in [event][filter_attack]. This PR is there to remedy this double problem.
Also remove matches_special_filter and directly use matches_filter.
It's better to disable them that to get in the habit of ignoring the CI fails
from the following two issues; this can be reverted once either is fixed.
glib has a bug where it builds things out of order which results in it failing
to build the dependencies, which fails the build.
https://github.com/microsoft/vcpkg/issues/28722
vcpkg also has a bug where it very often fails to use the cache of the
previously built dependencies even if none of them changed, which then makes it
rebuild all the dependencies again.
https://github.com/microsoft/vcpkg/issues/26601
If the glib bug was fixed, then the errors wouldn't happen since rebuilding the
dependencies wouldn't fail. If the caching bug was fixed, then the errors
wouldn't happen since it'd just reuse the cached dependencies.
Previously it was checked whether the logs directory was writable, which needed to get the log directory, which needed to get the userdata directory, which causes the userdata paths to get initialized, which triggered log rotation. This resulted in rotation being triggered before the logging path was set, which resulted in it always being skipped. Now log rotation is done in the logger class after it has been checked whether the logs directory is writable or not.
unlike find_child which returns an optional, this returns
reference, and throws when no such child is found.
This was intended but forgottten for the
"deploy optional_child" commit.
This fixes some codes that used config::find_child and
relied on the throwing behaviour by catching config::error
Use int for measurements of pixels, vs std::size_t for container sizes.
The scroll_bottom() methods were never called, although scroll_top() is
used when switching between subgroups. The logic is scroll_bottom() was
broken; items_start wasn't changed inside the loop, so the loop would
run at most once.
Use std::size_t instead of unsigned int for container sizes.
There's one place where it still uses signed int, for using a negative index to
access children from the end of the array. Overflow shouldn't be a worry here,
as it would require 2**31 objects to be in the container, implying the container
and children would use at least 32GB even if every child object was empty.
Co-authored by: Pentarctagon
Fixes#5302, planning mode now no longer tries to set the
defendings unit animation to "standing" during an attack when
there were planned moves for the defender.
The event changed the gamestate by adding an event
that changes the gamestate. We now use variables to instead of
nested events events since that is easier to handle in
[on_undo], which allows us to use [allow_undo] here.
Previously the config class had an operator bool and
it was a common pattern to use if(const config& = cfg.child(..)).
While this pattern was nice to use. It has severe drawbacks, in
particular it was unclear whether a function that took a config&
parameter allowed "invalid" configs, while most functions
did not, there were some that did. Furtheremore it lead to a few
buggy codes that were unconvered by this change (Not fixed though!),
in particular codes that tested local config objects that were
not references to being invalid, which could never be the case.
This commits replaces those with just `true` in order to not
change behaviour.
Some obvious cases were also removed including for example
things like `assert(config());` There is ony case in the ai code
that i'm not 100% sure of where one implementation of a virtual
function checked for an invalid config and another one that didn't.
With this, all code that check for a config child to be
present now uses config::optional_child which returns an object
that behaves similar to optional<(const) config&>, so it throws
on invalid dereferencing. But it also has operator[string] for
convinience, in particular to make is similary
easy to use the the previous `if (config& = .. child())`.
Also it has a tool DEBUG_CONFIG which tests whether all
optional_config values are checked before they are derefereneced.
Another method manditory_child was
added that throws when the key is not found, which replaces all
occurances of child() that did not check whether the result was
valid. This was neccecary (this= adding a new method instead of
renaming .child) to keep track of converted changes, and be sure
no occurances of child() were accidentally changed to the
throwing version.
We might want to rename one of mandatory_child or optional_child
to just child later. Not sure which one yet. I think it's better
to keep it in the current state (no config::child() ) for a while
though, so that people that currently used child() in their open
prs or other work get an error and not wrongly rely on the previous
behviour of config::child.
The interface of vconfig was not changed in this commit.