Since there were weapons included that weren't shown, it was possible for the best
weapon selection to be a hidden one (in which case, the initial selection would be
wrong, and it was possible for the returned index to point to a hidden, disabled
weapon.
This resolves both issues by excluding these disabled attacks from the weapon choices
list altogether. They aren't considered when calculating the best attack either.
mouse_handler::fill_weapon_choices is also used in mouse_handler::attack_enemy_, but
I don't foresee this change should cause any issues there, since you aren't supposed
to be able to actually attack with disabled weapons anyway.
(cherry-picked from commit 00e58f12f9a57b2e25dd4f67efb1255b177e173b)
* UtBS 5: changes to scenario locations
Fixes#3077:
* Moved AI leader spawns to keeps
* Changed spawn of trolls that were spawning in walls
* Sanity-checked village ownership in cavern
Fixes#3078:
* Changed spawn of Eastern Troll Flamecaster
* Fixed entry routes of Troll Flamecasters
From author notes:
* Made 'Wounded Dwarf' a wounded unit
(cherry-picked from commit 7feb9aee113def823d506f987d0bee737da60ed7)
There were two overlapping problems: 1) the branching was written incorrectly (due to combining top-level and [if] filters) and 2) the first [defend] tag getting merged with the base WC/Soulless defense animation.
(cherry-picked from commit 131868581d1bb22c2d5612e223657951489e6c1d)
Another efficiency improvement. This ensures that the side of the unit
is checked first before the potentially complex rest of the filter is
evaluated.
(cherry-picked from commit 6c38b8ce934ea68bd11a3aa960a91fe6f9dbfb87)
This is for efficiency reasons, as location filters do not necessarily
change throughout a side’s turn, while fewer and fewer units have moves
left.
(cherry-picked from commit 0dcbe1d0d0b1dda90a0fa649120348b7542f2644)
The old method is very slightly faster in some circumstances (e.g. for
simple filters and when all units have moves/attacks/etc. left), but we
are talking fractions of micro seconds. By contrast, depending on the
filter used, the new method can save large amounts of evaluation time
once some units have move or attacked.
(cherry-picked from commit 972ecc2f56c3cc1391db165518324b1a3757431d)
If dc happens during asio read that would call server::add_player
then a "ghost" player will appear in games_and_users_list_. Fix works by
moving the list update into the handler, it will be called only if read is
successful.
This should prevent issue #2989 unless it has some other mechanism
(cherry-picked from commit 787a1a0dae41e68d237cacd9ceca381d6dad76df)
This is a debug mode-only dialog. If I want to spawn a unit, the game
had better allow me to spawn any unit I want. do_not_list was created
for use by wmlunits anyway.
(cherry-picked from commit 085236f556dd485fe186473208bdf4438ec4826d)
This time I added an option to disable the feature to allow the currently
playing track to finish when changing the playlist. This allows more
fine-grained control of distinct use cases.
In wesnoth.cpp:do_gameloop(), I reversed the order of the title screen
music and default music because otherwise adding the default music would
enable play_once for the title screen music and prevent instant music
change when the player loads a save. I play title screen music with
immediate=yes, so it's still played first.
(cherry-picked from commit 91afbfd5868595e29a3147748c78652c88d6323e)
* now the situation can appear that spiders can attack Malifor,
this handles it.
* add *^Xo Terrain to the filter. While there is no bug to fix,
it looks like it belongs there too.
* work around a tile glitching with an [item] at 22,4
* remove code referring to removed variables
* and run wmlindent
[ci skip]
(cherry-picked from commit fc427ce58c6ce2c3948711207e67c646d2295951)
NR S5a: bugfixes
* Fixes#3117 - Malifor damage event now occurs on defence as well on attack
* Fixes#3116: - Doors to the study can now be opened from inside
[ci skip]
(cherry-picked from commit 913b77d79d9ac0fb4d67ac1461811aeb691daa60)
See comment for explanation. This was a better solution that adding mutexes to
the cache accessors; that had performance downsides.
(cherry-picked from commit 011cbfe3b8fd2d634e3294484f4cb9b255eac029)
This reverts commit 6d0b7c84243aba8444f5e722cd855feed3501f12. Turns out there's
a better way to fix this problem without using mutexes, which have a noticeable
performance hit (5.2% of the execution time of game_display::draw_invalidated()
according to @jyrkive).
(cherry-picked from commit b8ad791a1d8d1e76d921d4f48a6fd57aee3c134e)
[ci skip]
This better conveys its behavior, especially with the introduction of the hidden PRNG
preference.
(cherry-picked from commit bf92dbbfd2c1699a9af11e6ddc1b850e154d16f9)
[ci skip]
Also fixed an error in my last commit that gave your ally Dwarvish side *more*
gold on higher difficulties.
(cherry-picked from commit a46eaa28749e48cf4027d1ec4523439b8407bc9b)