Commit graph

84162 commits

Author SHA1 Message Date
sprunk
44f54bb57a Fix #9241, Liberty S1 dialogue item tweak
Extends damage and not the number of hits, so use "heavier rocks" instead of "more rocks".
2024-08-24 18:55:29 +10:00
Gunter Labes
6293a503e0
Merge pull request #9133 2024-08-24 06:41:03 +02:00
Nils Kneuper
d4b2d151ce updated copyrights for Turkish image update 2024-08-23 15:00:00 +02:00
Nils Kneuper
e1c14ac2a7 applied "update_copyrights" script 2024-08-23 14:50:50 +02:00
Nils Kneuper
aef0d3d87d updated Turkish translation 2024-08-23 14:48:01 +02:00
Nils Kneuper
38aef96b64 updated Chinese (Simplified) translation 2024-08-23 14:30:06 +02:00
Nils Kneuper
0fa48e2088 updated British English translation 2024-08-23 14:29:06 +02:00
Nils Kneuper
41896cabf9 updated Bengali translation 2024-08-23 14:27:53 +02:00
Iris Morelle
1ae764bd35
Merge pull request #9173 2024-08-22 17:00:32 -04:00
Gunter Labes
0c278d38aa Make command line option errors consistently return 2 as documented
Also print the error before the dialog so you don't first have to dismiss it to see the message on stderr as well.
2024-08-22 18:33:12 +02:00
Celtic Minstrel
cff5630f88 Lua API: Explicitly set default deleter for string-constructed formulas
Fixes #9237
2024-08-22 01:46:59 -04:00
Gunter Labes
9b70484b4f
Fix an indent inconsistency and add missing final newlines 2024-08-21 21:48:04 +02:00
Charles Dang
e08fcd1061 Don't clone surface too early 2024-08-21 13:16:55 -04:00
Charles Dang
365fe71e2c Only need read access for in_mask_surface 2024-08-21 13:16:55 -04:00
Charles Dang
a6e931af11 Reduce cache lookups in is_empty_hex 2024-08-21 13:16:55 -04:00
Charles Dang
e22c376d01 Fix possible regression from 457ed4bb43
I don't know if modifying this value in cache would cause issues, but better safe than sorry.
2024-08-21 13:16:55 -04:00
Charles Dang
bafe62948c Don't use exception bounds checking for image caches 2024-08-21 13:16:55 -04:00
gfgtdf
c15df9d3f5 fix #9225 events with negative priority getting erroneously deleted
previously is_map_[id] would point to the wrong event, so that when an event was later deleted by id the wrong event would be deleted.
2024-08-21 02:08:47 +02:00
Celtic Minstrel
4927e71ed1 Fix crash if string_to_color is passed an empty string 2024-08-20 13:42:26 -04:00
Celtic Minstrel
e338869b01 Down with wmlindent!!!
Why on earth does it want to indent line continuations by another level!?
2024-08-20 13:41:46 -04:00
Celtic Minstrel
387499532c Encyclopedia: Fix inconsistent indentation and break up the lists in every topic 2024-08-20 09:06:43 -04:00
Wedge009
cb144c5739 Encyclopedia clean up following #9188.
[ci skip]
2024-08-20 21:39:33 +10:00
Gunter Labes
d46dbef39b
Warn about external paths 2024-08-20 09:14:47 +02:00
Gunter Labes
5da4160d87
Correct confusing handling of ./ paths
Warn about unresolvable paths instead of returning a bogus path or nothing.
2024-08-20 09:14:47 +02:00
Wedge009
a88d7ef1f8 Cats: Remove non-standard spacing and replace straight quotes.
[ci skip]
2024-08-20 16:53:34 +10:00
Charles Dang
56d05b166b Make more use of std::clamp in surface utils 2024-08-19 15:48:22 -04:00
Charles Dang
f6ae75f9ed Remove sdl::fill_surface_rect 2024-08-19 15:45:33 -04:00
Charles Dang
4722c01c55 Remove an assert 2024-08-19 13:06:52 -04:00
Gunter Labes
150a738b39 Simplify game_config::path determination 2024-08-19 16:15:49 +02:00
Gunter Labes
8c581eee90
Avoid rewriting the same file multiple times
Also process some more extensions that current source files use.
2024-08-19 08:55:08 +02:00
Gunter Labes
0bb7395804
Make sure stdout encoding is UTF-8 2024-08-19 08:51:05 +02:00
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