Commit graph

84281 commits

Author SHA1 Message Date
Gunter Labes
3c45a5b0e7
Update and correct game config schema
Fix schema tags where "name" is a comma separated list which is not actually supported.
2024-08-19 08:25:55 +02:00
pentarctagon
04fe19bf6c 1.19.3+dev 2024-08-18 23:24:17 -05:00
pentarctagon
e865a5fd61 1.19.2 2024-08-18 23:22:05 -05:00
pentarctagon
92173108f1 pot-update and regenerate doc files 2024-08-18 23:20:19 -05:00
pentarctagon
bbeb3ab699 changelog_entries 2024-08-18 23:10:15 -05:00
Steve Cotton
bd8a5fa038 Add tests for [store_locations] with an SUF
Prompted by a discussion over [filter_weapon][not]
when a unit has no usable weapon.
2024-08-19 00:17:37 +02:00
Steve Cotton
4afdc92f13 New ability recursion tests using a four cycle
Using four abilities instead of two means the C++ checking_tag
mechanism needs to handle multiple values, or needs to be supported
by recursion counting.

The branching test lets one level of recursion finish, and then tries
to go deeper. This tests for bugs where a recursion detection tool in
the engine gets its count reset when exiting one level of recursion.
2024-08-19 00:07:41 +02:00
newfrenchy83
f272d9022e Add tests for recursive weapon filters 2024-08-19 00:07:41 +02:00
Steve Cotton
743b146efc Fix weapon special filters can lead to infinite recursion
This adds a recursion counter which runs on a per-weapon basis; if the
recursion limit is reached then the last level of recursion is assumed
to have returned false. A warning is printed (with error severity).

At the user-visible layer, that gives the following logic:

* Abilities that depend on another ability being active will be
  inactive.
* Pairs of abilities, where X depends on Y being inactive and Y
  depends on X being inactive, will end up with them both inactive.

The limit is defined by ATTACK_RECURSION_LIMIT in attack_type.cpp.
The minimum for passing all the unit tests is 2, but I've left some
headroom by setting it to 4.

With the recursion limit set to 1, the following tests fail, which
seems reasonable because they're checking that the special is on
a particular type of weapon.
* event_test_filter_attack_specials
* event_test_filter_attack_opponent_weapon_condition
* event_test_filter_attack_student_weapon_condition

Output from the four_cycle_recursion_branching test:
```
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = parry'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = poison'
error unit: Recursion limit reached for weapon 'melee_attack' while checking filter 'special_type_active = damage'
```

There's deduplication to prevent the logfiles getting spammed during
AI turns. As implemented, the two tests mentioned below print 3
messages each; these tests are added in separate commits because the
tests are shared between PRs while we discuss the right mechanism for
guarding against recursion.

With no rate limit:
* four_cycle_recursion_branching prints 1280 logs
* event_test_filter_attack_student_weapon_condition prints 320

With a rate limit via a flag that's reset in recursion_guard's destructor:
* four_cycle_recursion_branching prints 80 logs
* event_test_filter_attack_student_weapon_condition prints 160

Resetting the flag in specials_context_t's destructor gets better numbers,
but splits the logic across .cpp files. I think the trade-off isn't worth it:
* four_cycle_recursion_branching prints 40 logs
* event_test_filter_attack_student_weapon_condition prints 132

Co-authored-by: newfrenchy83 <eric.belleux@gmail.com>
2024-08-19 00:07:41 +02:00
Toom
cac16cbdf1
add tooltip to [unit_vision] (#9191)
closes #7636
re #6021
re #5575
2024-08-18 17:00:06 -05:00
Gunter Labes
e0a424d675
Remove unused struct 2024-08-18 20:34:34 +02:00
Charles Dang
c8a477383d Fixup 791eed42cf 2024-08-18 14:25:38 -04:00
Charles Dang
21254d5172 Game Config: don't copy palette vector (it's big) 2024-08-18 13:56:49 -04:00
Charles Dang
9c1c442f31 Color Range: fix possible uint8_t overflow 2024-08-18 13:56:17 -04:00
Gothyoba
71e0d142d6 Remove reference to Aspenger’s Syndrome in HttT S20b comment
The change to Alzheimer’s Disease was suggested by CelticMinstrel some time ago in #7545
2024-08-18 12:47:19 -04:00
Gunter Labes
55f6c69f68
Use non-reference type to explicitely show the copy
This appeases -Wrange-loop-bind-reference as in every other all_children_range use in a range-for loop.
2024-08-18 16:49:53 +02:00
Eric Gallager
4915f3be86 wmlscope: fix format of magic comment in documentation
It's not just `prune`, but rather `wmlscope: prune`
2024-08-18 10:56:50 +02:00
Charles Dang
3dc19a9808 Mark texture state getters const 2024-08-18 00:54:54 -04:00
Charles Dang
9d35d56b8b Fix spurious errors when no minimap to draw
It is possible (oddly enough) to completely disable any minimap drawing. So this isn't an error condition.
2024-08-18 00:54:19 -04:00
Charles Dang
f9e2700991 Fix clip rect regression from 283e52222a 2024-08-17 22:29:39 -04:00
pentarctagon
32063bfc7c add disable ability tests 2024-08-17 21:13:10 -05:00
Charles Dang
89f99f70ca Fix broken ~CS()
Originally messed up in 029136b19a
2024-08-17 21:33:30 -04:00
Charles Dang
f65fdb3270 Remove assertions about SDL_ALPHA_TRANSPARENT 2024-08-17 21:20:35 -04:00
Charles Dang
169c87a8a5 Remove get_pixel and put_pixel 2024-08-17 21:19:15 -04:00
Charles Dang
abbb9707b9 IPF: mark virtual functions override 2024-08-17 21:18:40 -04:00
Charles Dang
457ed4bb43
Conduct surface manipulation in-place when possible (#9218) 2024-08-17 20:22:44 -04:00
Charles Dang
fb1232e4ea Fixup 5170615e03 2024-08-17 16:16:34 -04:00
Charles Dang
6d258e20de Remove surface::operator< 2024-08-16 00:25:06 -04:00
Charles Dang
ce740656fd Remove image::locator::file_exists in favor of image::exists
Identical codepaths except the latter involves the cache.
2024-08-16 00:24:27 -04:00
Charles Dang
3dad5f4e62 Unit/Animation: make frame_parameters a proper aggregate 2024-08-15 21:31:26 -04:00
Charles Dang
824df30778 Unit/Animation: aggregate cleanup 2024-08-15 21:30:47 -04:00
Charles Dang
d33b4554ef Added AGGREGATE_EMPLACE compat macro 2024-08-15 21:27:10 -04:00
Charles Dang
5170615e03 Don't clone surface when getting non-transparent rect 2024-08-15 21:26:24 -04:00
Charles Dang
cdec7adecf Get max xbrz scale size from lib
Bumps the max to 6
2024-08-15 19:36:20 -04:00
Charles Dang
d7a9421d26 Remove unused scale_surface_nn
XBRZ version of NN scaling, which we have already with scale_surface_sharp.
2024-08-15 19:34:16 -04:00
Charles Dang
8bf49639ea Fix build on VS 17.11 2024-08-15 19:30:23 -04:00
newfrenchy83
8f20c12e3d fix incomplete add [disable] abilityto abilities used like weapon special 2024-08-14 19:39:35 -05:00
pentarctagon
0cf9490409 handle preferences case change
Fixes #9199
2024-08-14 19:33:54 -05:00
Charles Dang
c5e0b3eefb GUI2/Drawing: don't assert on empty [draw] 2024-08-14 14:03:37 -04:00
Charles Dang
4058f866d6
Remove UNUSED (#9210) 2024-08-14 13:55:58 -04:00
Subhraman Sarkar
6980ad04d6 gamestate inspector: use uneditable scroll_text instead of scroll_label
allows text to be selected and copied
2024-08-14 12:03:39 +05:30
Subhraman Sarkar
18a08fbbef muliline text: improve slowdown and line calculation algorithm 2024-08-14 12:03:39 +05:30
Subhraman Sarkar
cf5cc8ec3f text renderer: remove caching and get_byte_offset, add get_cursor_pos_from_index 2024-08-14 12:03:39 +05:30
Charles Dang
b874b8c6d4
Update xBRZ to v1.8 (#9208)
* Update xBRZ to v1.8 (resolves #8307)

This replaces our implementation with stock xBRZ sans any of our custom code. Made these changes from plain source:
- Renaming .h -> .hpp
- Conditionally use [[likely]]
- Added a trailing newline
- Comment out unused parameters
- Disable `-Wunused-function` warning on macOS
2024-08-14 01:13:37 -04:00
Charles Dang
dac8f6f5e0 Mark draw RAII getters [[nodiscard]] 2024-08-13 21:56:46 -04:00
Celtic Minstrel
8baf95601d [LuaDoc] Mark filesystem.asset_type as an enumerator 2024-08-13 08:54:04 -04:00
Celtic Minstrel
d2983f849b [Lua] Read campaign ID from scenario settings instead of mp_settings. 2024-08-13 08:54:04 -04:00
Celtic Minstrel
233237be1e [Lua] Add some TODO notes on things to come back to later. 2024-08-13 08:54:04 -04:00
Celtic Minstrel
a277073e36 [Lua] Remove some internal implementation functions from the external ai_helper interface.
There are no callers in mainline. The functions are not meant to be called directly at all – for each, there are wrapper functions that are intended to be called instead, which are still exposed.
2024-08-13 08:54:04 -04:00
Celtic Minstrel
faaeaadaa1 [Lua] Avoid missing field warning by reversing the order of the check 2024-08-13 08:54:04 -04:00