81407 Commits

Author SHA1 Message Date
Celtic Minstrel
6876695e66 Support as_type=unit in [variable]formula= 2022-11-27 13:12:47 -05:00
Celtic Minstrel
516f043e89 Support name= in [lua] ConditionalWML 2022-11-27 13:10:41 -05:00
Nils Kneuper
e9b86c2ff6 updated Finnish translation 2022-11-27 12:27:58 +01:00
Steve Cotton
3d4812ebc8 Add a unit test for the preprocessor's #ifdef handling
This one's surprising, but it's the behavior of 1.16, so add a test for the
current behavior even though I wonder if it should change in 1.17.
2022-11-26 14:55:33 +01:00
Nils Kneuper
7b4c166761 updated French translation 2022-11-26 13:44:18 +01:00
Steve Cotton
710867e010 Add unit tests for interpolated event names and end_turn
Move `event_name_variable_substitution` to the top of the file, as it's testing
that the event triggers at all, before the tests that check which order the
events are triggered in.

The old `order_of_variable_events1` seemed to be a combination of two tests that
should exist, but the code didn't quite test either of them. This replaces it
with a new `order_of_variable_events1` and `order_of_variable_events3`.

Docs partially written by Pentarctagon, this started as a review comment
on the documentation PR.
2022-11-25 12:16:46 +01:00
Charles Dang
14bd90629c
Merge pull request #7162 from Pentarctagon/fix-7104
Don't call back() if open_window_stack is empty since that's UB.
2022-11-25 02:37:51 -05:00
Pentarctagon
80fb5650b1 Don't call back() if open_window_stack is empty since that's UB.
Resolves #7104
2022-11-24 21:01:35 -06:00
Pentarctagon
a242f42067 Initialize filter_auto_hosted_ 2022-11-24 09:54:49 -06:00
Pentarctagon
a2491d3aa4 More unit test documentation. 2022-11-23 16:25:37 -06:00
Andrei-Florin Bencsik
5ffa031e8e
Remove some un-needed references and optimize some string operations (#7135)
when returning by value, the ideal way to store the returned value is
another value - using a const& works only because of how c++ prolongs
the lifetime of temporaries with const&'s

use move on strings that get destroyed at scope end

fix some formatting differences between a couple functions (parens,
spaces)

formatting to match the coding guidelines, including fixing up existing code
use [] to be consistent with the file
put { on the same line as for and if
2022-11-23 01:12:32 +01:00
Tahsin Jahin Khalid
0afe343c50
HttT: Kalenz now has traits loyal, and resilient (#7142)
Elven Supremacy
2022-11-22 09:26:20 +08:00
Pentarctagon
94d9cdb2db Move entry. 2022-11-20 15:06:37 -06:00
Charles Dang
59bb2bb47b
Merge pull request #7150 from newfrenchy83/include_erase_if_in_overwrite_specials
include Refactor ability lists using utils::erase_if and std::remove_if to overwrite_specials
2022-11-20 14:14:00 -05:00
newfrenchy83
697a9cabc1 return boolean value directly 2022-11-20 18:34:01 +01:00
Pentarctagon
5ac61ee1aa Forgot to do this. 2022-11-20 11:10:51 -06:00
newfrenchy83
55562687a6 include Refactor ability lists using utils::erase_if and std::remove_if to overwrite_specials 2022-11-20 15:48:57 +01:00
Steve Cotton
67f2c32c54 Refactor ability lists using utils::erase_if and std::remove_if
C++20 will add std::erase_if as a convenience wrapper around std::remove_if,
handling the subsequent call to std::vector::erase. This simplifies readability,
avoiding the need to either store the result of std::remove_if in a temporary
or to put the second argument of vector::erase after the body of a lambda.

This adds utils::erase_if, which does the same thing. The C++20 function returns
the number of elements removed, but as none of the callers need that I've not
implemented it in utils::erase_if.

This commit omits the refactor of attack_type::overwrite_special_checking,
because that function is being worked on in parallel by Newfrenchy. It'll be
simpler for either of us to update it later instead of creating merge conflicts.
2022-11-20 15:20:29 +01:00
newfrenchy83
337f88091d
Further simplification of overwrite_specials attribute code (#7144)
Using the first loop to define three boolean variables is more complicated than simply eliminating from the 'overwrite_specials' list the abilities not carrying the attribute then; if an ability with the attribute is present define a double for loop inside each other, where for each ability with overwrite_specials the type of ability removal from the returned list is defined at that time (one_side or both_sides).

I eventually want to be able to be even more selective about the abilities that can be removed or not and extend the use of the attribute beyond chance_to_hit. When (and if) these two PRs will be merged in master, I will have to add 3-4 lines of hardcoding to implement the filtering). Building a list instead of splicing the existing one is incompatible with this project.
2022-11-20 15:17:02 +01:00
Nils Kneuper
40a64b5cbf fixed error in arabic translation (I hope...) 2022-11-20 13:38:33 +01:00
Nils Kneuper
fb3e653fe1 updated British English translation 2022-11-20 11:19:05 +01:00
Nils Kneuper
a7b39bd899 updated Arabic translation 2022-11-20 11:15:31 +01:00
Pentarctagon
6c7dd0a25b 1.17.10+dev. 2022-11-19 23:38:26 -06:00
Pentarctagon
79b2385140 1.17.10. 1.17.10 2022-11-19 23:38:25 -06:00
Pentarctagon
0118664f0f pot-update and regenerate doc files 2022-11-19 23:38:25 -06:00
doofus-01
4646f5c720
Update changelog.md 2022-11-19 16:50:33 -08:00
doofus-01
94cc48427f
1.17 dunefolk falconer portrait (#7061)
* adding dunefolk falconer portrait
2022-11-19 16:45:43 -08:00
Andrei BENCSIK
2534c6184e Refactor autodetect_game_data_dir into function
the code that does autodetection looked like it could be put inside a
function - add a function that explains what it does

avoid some string copying and move where possible

use scoped ifs (c++17) to limit scope of local variables
2022-11-19 12:34:14 +01:00
Tahsin Jahin Khalid
fa21978458
HttT S14: give Relgorn his missing traits
Note: he only appears for 1 scenario, and in an ending cutscene. Does not affect balance or difficulty.
2022-11-19 15:26:24 +08:00
Steve Cotton
e3deff8bfd Make undo work again, undeprecate on_event()
Fixes #6898. The issue is that non-WML events added through the new events API
always disable undo with no equivalent of WML's `[allow_undo]`. The long-term
fix is to add a way to do that; however until that's available then listeners
for `moveto` need to use the old `on_event` API. The old `on_event` API can't
be deprecated yet, and this is enforced by our unit tests (the build fails if
there are unexpected deprecation warnings during the tests).

Reverts most of 7e234f8833282424b3535b9c334c751748f7222b. Does not revert files
that only listen for non-undoable events such as `die` or `new turn`.

Reverts the deprecation part of #5663's 8cd133263058a5df85f64988e348d2cf54d13a48.
2022-11-19 05:23:30 +01:00
Andrei BENCSIK
aa3d399f9d use emplace_back()'s return to swap string 2022-11-19 05:22:31 +01:00
Andrei BENCSIK
03a70c5a2d Simple refactor in read_argv
use argc to reserve space in the args vector
remove explicit constructor used in `push_back` vs `emplace_back`
2022-11-19 05:22:31 +01:00
Nils Kneuper
22c304f336 updated French translation 2022-11-19 02:10:12 +01:00
Pentarctagon
2fa3f32eec Changelog update. 2022-11-18 09:57:54 -06:00
Tahsin Jahin Khalid
f33480e3c0 HttT S14: give Relgorn his missing traits 2022-11-17 15:58:24 +08:00
Jonathan-Kelly
eac522597d Slightly reduce merfolk forest and hill move cost
From 5 to 4. Makes moving them from one water body to another somewhat less tedious. Likewise makes merfolk units a bit more viable on maps with separated waterways.
2022-11-16 22:39:29 -06:00
Tahsin Jahin Khalid
06297cfdc6
Make Nightblade the default advancement for Slayer
Make Nightblade the default advancement for Slayer
2022-11-17 12:03:26 +08:00
Wedge009
ced504a97f LoW S9: Remove standard enemies-defeated as a victory condition.
Resolves #7130.
2022-11-16 11:54:01 +11:00
Jonathan-Kelly
1ba0a11a18 Make Nightblade the default advancement for Slayer 2022-11-14 17:22:25 -05:00
Wedge009
bdc236e0a0 Disable saving of replays for story-only scenarios.
Resolves #6180.
Resolves #7123.
2022-11-14 19:54:05 +11:00
doofus-01
b0d327ea3c
1.17 - standing animations for zombies (#7102)
* standing animation for default walking corpse

* mounted (horseman) WC standing anim

* default soulless standing animation

* mounted soulless standing anim
2022-11-13 16:47:22 -08:00
Pentarctagon
b1587223a1 Add some more unit test documentation.
Also split some larger tests into multiple smaller tests.
2022-11-13 16:35:06 -06:00
Wedge009
765cf1e79f Add screenshots directory to game version dialogue.
Resolves #7096.
2022-11-12 20:34:33 -06:00
Nils Kneuper
540b3a1fe3 updated Czech translation 2022-11-12 19:43:05 +01:00
Nils Kneuper
4edc8ef73e updated French translation 2022-11-11 18:39:59 +01:00
Iris Morelle
b6f8d971e7 Use std::size_t instead of int for generic iteration
This was caught through a mishap with -Wshorten-64-to-32 on Xcode,
and seems like a disaster waiting to happen with a sufficiently
large input ("this will never happen" kinda stuff waiting to be
proven wrong).
2022-11-09 14:19:35 +01:00
doofus-01
3f4eebc177
1.17 Horses updates (#7072)
* update great horse

* update white horse

* update dark horse
2022-11-06 12:45:20 -08:00
Nils Kneuper
2a56e6957a Polish translation: removed some "\v" that should not occur 2022-11-06 11:16:41 +01:00
Nils Kneuper
fc291a1fef updated Polish translation 2022-11-06 11:15:10 +01:00
Nils Kneuper
2fc6ab051b updated French translation 2022-11-06 10:48:07 +01:00