81803 Commits

Author SHA1 Message Date
gfgtdf
fc5b0ce44d Call sync.do_final_checkup() before send_user_choice()
Generating the chackup data before sending the action
means that other clients would have the checkup available.
(if the "default_checkup" is used the "mp_debug_checkup"
also works after the action is sent). Note however that
its very possible that the action was already sended
before this code is reached, in those cases this change
will have no effect.
2023-04-01 05:49:35 +02:00
gfgtdf
d282bb407a Send actions sooner when undo is blocked
This also removes some outdated comments. In
particular sqashing undo actions into one (like
a comment suggeested) would probably bring the
undo stack out of sync with the replay stack.
2023-04-01 05:49:35 +02:00
gfgtdf
ca53d08fba Automaticially update shroud when disabling DSU
Not having the shroud updated while dsu is disabled
could lead to shroud not being updated at all or worse

It is a bit annoying to works on code that should actually
be removed (DSU), but the whiteboard still doesn't work perferctly.
2023-04-01 05:49:35 +02:00
gfgtdf
451463d45b small cleanup in undo_list::redo()
This also removes some outdated comments-
2023-04-01 05:49:35 +02:00
gfgtdf
b7a85ee0fc Fix error when idleing a side
We don't want to return from play_idle_loop() when
the game is waiting for a [init_side] or [end_turn].
These actions should be delayed until the side has a
real controller.
2023-04-01 05:49:35 +02:00
gfgtdf
ed602bad24 Don't assert on possible replay input.
asserts should only be used on conditions
that can be guaranteed to be true. Not on
data form external sources.
2023-04-01 05:49:35 +02:00
gfgtdf
683c5d06a5 More robust checks for blocked undoing
1) Renamed !can_undo -> undo_blocked
2) We now automaticially clear the undo stack after every
   action that blocked undoing. Since the playturn code
   checks undo_stack::can_undo() to check whether to send
   data or not this should make it more robust against
   errors caused by unsent turn data.
2023-04-01 05:49:35 +02:00
gfgtdf
8bcd731f7a Fix turn_end_requested_ not reset on reset_gamestate
This caused the end_turn button to remain 'pressed' when
using "Replay from turn".

There are now two variables end_turn_requested_ which is
true when the end turn button was pressed, and
end_turn_forced_, which is true when [end_turn] was used.
The later is considered part of the gamestate, to it is
stored in savefiles, the first isn't.

Alternatively we could make sure the synced action that
invokes the [end_turn] ends the turn directly instead of
using a seperate [end_turn] action for that.
But then we'd need to come up with a way to notify the
server about the turn change. (which wouldn't be hard
though, we'd use a similar mechanic as we aleady use
for side changes done by wml)
2023-04-01 05:49:35 +02:00
gfgtdf
ad5456053a simplify playmp_contoller::wait_for_upload()
This function also was missing a send_data() call to send the
last action (which probably caused the game to end), i actually
don't know how this passed the ./mp_tests before.
2023-04-01 05:49:35 +02:00
gfgtdf
d2a01b41b1 don't keep empty shroud updates on the undo stack
previoulsy undo_stack::can_undo() coudl return the wrong value since
it only contained a srhodu update that cannot be undone
2023-04-01 05:49:35 +02:00
gfgtdf
40fbf95b80 Skip over empty sides at gamestart
This was forgotten in my recent gameloop refactor
2023-04-01 05:49:35 +02:00
Steve Cotton
7e1044b6e5 Make rng::get_random_element return an index, not an int
This makes it match the documentation, although it makes no practical
difference, other than solving one of the -Wshorten-64-to-32 warnings.
2023-03-30 07:57:57 +02:00
Charles Dang
e4c050f92c
Merge pull request #7494 from wesnoth/image-cache-cleanup
Overhaul image cache to be hash-based rather than index-based
2023-03-30 01:01:41 -04:00
Charles Dang
9699377ee0 Gets rid of that dreadful last_index stuff. It basically meant a slot was reserved for every image locator in every cache
(even if never populated) rather than only the needed cache. The index was also never reset for the lifetime of the program.
This new design uses a hashmap based on the locators themselves.
2023-03-29 20:44:36 -04:00
Charles Dang
a0bdf69459 Replace hotkey::get_category_names with hotkey::get_translatable_category_name 2023-03-28 01:31:12 -04:00
Charles Dang
2c43fbb7af
Merge pull request #7492 from bencsikandrei/remove-ebo-static-assert
remove static_assert used only for testing
2023-03-28 01:13:44 -04:00
Charles Dang
d26539bddc
Merge pull request #7488 from bencsikandrei/minor-fixes-filesystem
Minor fixes filesystem
2023-03-28 01:13:05 -04:00
Jonathan-Kelly
3775ec81ea
Update WoF (#7480) 2023-03-27 22:14:03 -04:00
gfgtdf
c1a9408d91
Fix bad error message when using "Back To Turn"
Fixes in Particular "Yes/No" being inverted in that dialog
2023-03-28 02:57:34 +02:00
gfgtdf
549b0ae31f
Don't start replay immediately when using "Back To Turn"
This should be less stressful for players. And allows them to observe the gamestate at the time of the save.
2023-03-28 02:49:17 +02:00
Wedge009
e917bf98e6 DiD S8: Disallow undead bat from retrieving the Book.
Resolves #7485.
2023-03-28 08:44:06 +11:00
Andrei BENCSIK
d432f41b71 remove static_assert used only for testing 2023-03-27 23:19:44 +03:00
loonycyborg
0e312fb74d
Generalize EBO affirming static_assert
so it doesn't depend on pointer size 8
2023-03-27 16:53:24 +03:00
Andrei BENCSIK
b891e92f42 avoid multiple copies of default_blacklist in TUs including filesystem.hpp 2023-03-26 23:59:19 +03:00
Andrei BENCSIK
5b812b857b remove duplicated includes cpp/hpp 2023-03-26 23:50:24 +03:00
Andrei BENCSIK
7bff35f991 EBO for unique_ptr with SDL_RWops 2023-03-26 17:36:57 +02:00
Pentarctagon
ee2c2fb8a9 Fix labeler actions error. 2023-03-25 09:14:07 -05:00
Nils Kneuper
b98a7774f4 updated French translation 2023-03-25 12:06:15 +01:00
Nils Kneuper
ba031ee873 updated Bulgarian translation 2023-03-25 11:27:46 +01:00
Nils Kneuper
914a90b312 updated British English translation 2023-03-25 11:26:29 +01:00
Gunter Labes
1dd72e709a
Simplify UNIT_BODY_SOULLESS_GRAPHICS macro 2023-03-24 13:29:16 +01:00
gfgtdf
c09fdae990
remove oudated comment 2023-03-23 17:11:42 +01:00
alberic89
3fec9dd423 Update INSTALL.md 2023-03-23 10:57:20 -05:00
Wedge009
2b0fa293b9 DW: Complete the move of Citizen to core. Resolves #7474. 2023-03-23 10:19:33 +11:00
Wedge009
5add73821b
DiD: Remove invalid syntax (#7470)
* DiD: Remove invalid syntax.
2023-03-22 15:31:29 -07:00
Pentarctagon
c6a6f8aa57 Unused include and variable. 2023-03-22 10:55:52 -05:00
Wedge009
b9acc00597 Replace deleted get_image() with get_surface().
Compilation broken since 9bb3408ab0fedb9b48baa65205da91fccdfc56de.
2023-03-22 18:54:40 +11:00
nemaara
60a5d3a9b7 DiD: add new secret scenario 2023-03-21 22:20:43 -07:00
Charles Dang
fa938c9fb1 Fix a lifetime issue with hotkey records (fixes #7183)
wmi_manager::set_item would replace a wml_menu_item object with a new one whose state was copied
from the old, but the old one was destroyed *after* the new one was constructed. That means when
the new object (and hence the new record) was created, it would not update the entry in the master
hotkey command info list, since the old still existed. The old object (and its record) would then
be destroyed, performing cleanup in the process, and resulting in the bug.

A new wml_menu_item object constructed from the state of the old one now takes control of its
record as well, so the new object has sole control over its lifetime and the hotkey info can be
appropriately updated.
2023-03-22 01:04:44 -04:00
Charles Dang
9bb3408ab0 Removed image::get_image wrapper 2023-03-22 01:04:30 -04:00
Pentarctagon
51b65dac85 Include not needed anymore. 2023-03-21 21:38:51 -05:00
Elvish_Hunter
f0413a1172 wesnoth_addon_manager: exit gracefully when removing a non-existing add-on 2023-03-21 23:21:09 +01:00
newfrenchy83
81f72539d9 update codeblock projectfiles 2023-03-21 14:15:38 -05:00
gfgtdf
43cddee180 Fix executing whiteboard actions during events #7465 2023-03-21 06:04:07 +01:00
gfgtdf
d5ef9feefb Fix planning mode on attacks
The code checked for `unit.attacks_left() >= attack_count_` even
though _currently_ it seems perfectly legal to invoke an attack
with less attacks left (see the discussion on #7406), although this
will probably be changed soon.

If this is changed in the future, before changing that assert
remember to also change the check in attack::check_validity.

Also it didn't reset the attacks in attack::remove_temp_modifier
properly.
2023-03-21 06:03:37 +01:00
gfgtdf
630464911c fix crash in whiteboard #3768 2023-03-21 04:31:11 +01:00
Toranks
2de929e026
Typo hander > handler (#7464) 2023-03-20 19:36:52 -05:00
Tahsin Jahin Khalid
3f2b588b98
Achievements: add 18 achievement frames for Icons
For mainline/MP/UMC
2023-03-21 00:59:48 +08:00
Luis Miguel Iglesias Sánchez
9c706ae656
Revert WML workarounds on mainline replay OOS issues (#7463)
* Revert changes in 91983c8

* Revert changes in 6551584

* Revert "Solve OOS by moving code to synced event"

This reverts commit 040550f0a6e3127505796ea120653b299c424cad.
2023-03-20 17:20:58 +01:00
Tahsin Jahin Khalid
9113be7348 achievement icons: resize to (72,72) 2023-03-20 22:50:35 +08:00