selected schedule will write to utils/schedule.cfg on scenario save
HOTKEY_EDITOR_CUSTOM_TODS is disabled unless user loads scenario
custom_tod:Preview button and associated callback added.
editor:translatable attributes now written with leading underscore
editor:support for multiple custom time schedules
This replaces the code for handling backstab with code that converts it to something new that still works.
Thus, the deprecation message is now INDEFINITE instead of PREEMPTIVE.
This additionally:
* Makes all copyright notices identical aside from the starting year for Wesnoth-specific source files. Files not included: mariadbpp, lua, spirit po, xbrz, and bcrypt (crypt_blowfish).
* Removes all attribution from the files, since the vast majority of them are outdated or seemingly just outright incorrect. For example, I would guess that Dave is no longer the sole author of the majority of Wesnoth's current code.
removes a call to get_ability_bool, in case that get_ability_bool
would return false, it would ot be faster than get_abilities, in
case that it returns true it is useless.
now the c++ code does no longer add a dummy time when
there are no times defines for an [time_area]. this is
in particular useful when one wants to define areas in
the map editor that is then used ingame for example in
filters.
We should consider renamaing [time_area] to just [area]
[time_area]s that don't define their own times schedule
are now ignored during tod calculation.
A few catch blocks modify something in their exceptions, so those are kept non-const.
(cherry-picked from commit 2bf4d68c87b69256266b7745a9e3453693794e35)
areas_ might be empty, so areas_[0] might crash, also returning areas_[0].hexes didn't really make sense in the first place
(cherry-picked from commit 41d7df970c43cd74413a93b635058e494dd67d78)
This was essentially only needed for the affects_side() helper. THAT'S IT. All this code just for
one single line... Anyway...
Utilized the display singleton's display_context getter instead. This also means fewer explicit
uses of resources::gameboard as the display_context object, meaning more compatibility with the
editor (not that that's relevant for most of the changed usecases, such as the AI, but it does
affect unit::get_abilities, which might be useful there in the future).
This also removes the display_context parameter from unit::invisible() since it was only passed to
unit::get_ability_bool().
unit::is_visible_to_team() also had its display_context parameter removed. It was used once as an
argument for invisible() and the other case was replaced with display::get_map().
(cherry-picked from commit 7e442cbb541b0bfbc5f3511fd1510fea80a4d34e)
I left the implementation of get_adjacent_tiles using messy C ptr arithmetic
since it most simply accounts for a few cases using arrays that are larger than
6 (such as in tod_manager) or underlying vector storage.
Also made use of std::array::size where applicable, and one case of std::array
iterators.
aspect_attacks_base::analyze_targets was changed to take a adjacent_loc_array_t
reference.
Partial revert of commit ecbb15e1c6d1106ff2f8e540c584523481426c04.
Replacing bounded_add() with std::clamp() in these contexts disables
time-of-day bonuses, since ToD bonuses (the base value in these functions)
are almost always outside the range set in terrain properties.
* Dropped bounded_add for clamp. There's a slight behavior change with this, namely that
base is no longer returned if it falls outside the bounds. However, for both usecases of
bounded_add, that behavior doesn't make sense. The wiki clearly states min/max_light=
define the bounds for light=.
* Replaced gcd with Boost's gcd function. We already use the latter in the Preferences
dialog, so this is more consistent.
* Simplified the implementation of in_ranges.
The unit::get_ability_bool() function accessed resources::gameboard that
is not set in the editor. Now the function receives the display context
as a parameter instead.
I also fixed two crashes on editor startup in MSVC debug builds (both
caused by indexing the teams vector when there aren't any teams), and the
GUI2 unit list dialog showing wrong status icons.