72394 Commits

Author SHA1 Message Date
Charles Dang
965b5e1648 Unit Attack: fixed issues arising from displayed items potentially not equally available items
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)
2018-10-07 03:22:24 +00:00
Severin Glöckner
322afd978a Tutorial: show the female fighteress in the help (if she is chosen)
Uses the workaround mentioned in #3012

[ci skip]

(cherry-picked from commit 18a101be6650fa19da900e680a29a39049ce69c0)
2018-10-07 03:22:24 +00:00
Thom Diment
f5c791d598 UtBS 5: changes to scenario locations (#3104)
* 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)
2018-10-07 03:22:23 +00:00
Charles Dang
d8086b1d35 Fixup this atomic_bool again
Apparently atomic types aren't copy-assignable.

(cherry-picked from commit 424e0e0ab44f51932c25e7bad364a9602f6c8bc5)
2018-10-07 03:22:23 +00:00
Charles Dang
cb90af3afe Added missing <atomic> include
(cherry-picked from commit bc0ad54ab096501d01e05f71a9299d67a970eb1e)
2018-10-07 03:22:23 +00:00
Charles Dang
a13791c23b GUI2: removed now-redundant type parameter from build_single_widget_and_cast_to
(cherry-picked from commit 34195ae6548131ef00aa894b4f82c7312fa140da)
2018-10-07 03:22:23 +00:00
Charles Dang
1b547fec0a GUI2: added a public static type getter to all widgets implementing get_control_type
Fixes #2400. See comment in styled_widget.hpp for details.

(cherry-picked from commit 52f7fcf5cc3d7446904df90381f467d15d4f5aad)
2018-10-07 03:22:22 +00:00
ln-zookeeper
2373407bd2 Restructured WC/Soulless bat variation defense animation (fixes #3215)
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)
2018-10-07 03:22:22 +00:00
Charles Dang
58880c8453 Ensure events::call_in_main_thread is thread-safe
(cherry-picked from commit b70463b6adbeb235ba24da315627c5dba79b5e75)
2018-10-07 03:22:22 +00:00
mattsc
a5e447a438 Update changelog with Lua AI efficiency improvements
(cherry-picked from commit 7afe6adbee971ddfbd23df67929a965ff57597d1)
2018-10-07 03:22:21 +00:00
mattsc
fa6da90138 Changelog: collect AI entries in 'AI' section
(cherry-picked from commit 7ed5b210b5aecffc5f9d34e468abe237783be158)
2018-10-07 03:22:21 +00:00
mattsc
22ca458bfd Goto Micro AI: add [and] to a filter
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)
2018-10-07 03:22:21 +00:00
mattsc
6a64e6e37e Goto Micro AI: change order of SLF and SUF evaluation
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)
2018-10-07 03:22:21 +00:00
mattsc
674a39a43e AI helper: improve efficiency of get_unit functions
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)
2018-10-07 03:22:20 +00:00
doofus-01
6d0cbe99fd UtBS: Graphics update for Giant Ant (#3190)
* graphics update for giant ant unit

* slight revision to ant base sprite

(cherry-picked from commit 9bb6cbb82c46a51aa9a3f4da2eefdcff9c4409e6)
2018-10-07 03:22:20 +00:00
Nils Kneuper
092687cdbe updated Italian translation
(cherry-picked from commit c9b7d5b22f574f8cc13a9430507caf6a6dacdc68)
2018-10-07 03:22:20 +00:00
Nils Kneuper
9d2522a2d0 updated British English translation
(cherry-picked from commit 5e35e4e8f3ab91aa4a1750bc9f9773b3b2ea91f7)
2018-10-07 03:22:19 +00:00
loonycyborg
231bb484e7 wesnothd: fix prematurely adding new players to games_and_users_list_
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)
2018-10-07 03:22:19 +00:00
Iris Morelle
325864d7f1 Changelog entry for the fix for issue #3206
[ci skip]

(cherry-picked from commit 94a85e0185d0a1b4f0ddf65128e5992f5ca63d28)
2018-10-07 03:22:19 +00:00
Iris Morelle
3505af2f09 gui2/unit_create: Do not exclude do_not_list units
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)
2018-10-07 03:22:18 +00:00
Jyrki Vesterinen
bcc914bfe8 Fix #2602: music doesn't change immediately on loading a save
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)
2018-10-07 03:22:18 +00:00
Jyrki Vesterinen
de1bdba769 Revert "Fix #2602: music doesn't change immediately on loading a save"
This reverts commit 94b69e028125f344dbb0e8fc1a76845891b291f2.

(cherry-picked from commit cafede479c70cbc2d70d052fd0c51e5c5440fa57)
2018-10-07 03:22:18 +00:00
loonycyborg
f8361aa7d1 wesnothd: fix server terminating in response to unregistered login
if unregistered logins are allowed

(cherry-picked from commit 0c0bf7f91d7654a7ac83861236b5e0589e1bbcaf)
2018-10-07 03:22:18 +00:00
loonycyborg
e1a7e08a92 wesnothd: avoid needlessly casting pointer to long int
(cherry-picked from commit a25180893344c6a99013e6b94eb3cb7110b1d987)
2018-10-07 03:22:17 +00:00
Iris Morelle
7b604c2a89 Fall back to the unit type name for [message] captions for nameless units
Fixes #3211.

(cherry-picked from commit 051182fa1c6fa75184d991920ff4e8e84831a848)
2018-10-07 03:22:17 +00:00
Jyrki Vesterinen
d5f66e229f Changelog entry for commit 94b69e028125f344dbb0e8fc1a76845891b291f2
(cherry-picked from commit b7c1007f34f6e5ff9c15e14b4cf1334b45749237)
2018-10-07 03:22:17 +00:00
Jyrki Vesterinen
097244559f Fix #2602: music doesn't change immediately on loading a save
(cherry-picked from commit 94b69e028125f344dbb0e8fc1a76845891b291f2)
2018-10-07 03:22:16 +00:00
sigurdfdragon
ae67350fd9 Update changelogs
(cherry-picked from commit c9c689da668e40d17e54cb8b2d8479a9df7149fc)
2018-10-07 03:22:16 +00:00
sigurdfdragon
009e789b8b DW: Fix #3207
...by preventing any allied units from moving to the sword.

(cherry-picked from commit 85ba7797b23fd2a98af33b61bfe22ea3e5f56f94)
2018-10-07 03:22:16 +00:00
Iris Morelle
5c04fe72d5 Don't allow [kill] animate=yes to scroll to units through fog and shroud
Restores 1.12's behaviour.

(cherry-picked from commit 4e37cdc713d054a48b1f31f43cb5511f42626847)
2018-10-07 03:22:15 +00:00
Severin Glöckner
8d282c97af NR S5a: more bugfixes
* 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)
2018-10-07 03:22:15 +00:00
Thom Diment
72775f4ebd NR5_1: Fixes to Malifor attack and secret door events (#3154)
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)
2018-10-07 03:22:15 +00:00
loonycyborg
77376ff378 wesnothd: restore lan server auto-shutdown functionality
(cherry-picked from commit 4eea1b5f0d4a0de9155c23be8a5abe097cf23f09)
2018-10-07 03:22:15 +00:00
loonycyborg
d3a6580908 wesnothd: restore functionality to log stats every 5 minutes
(cherry-picked from commit 0714d488bcd1eadd37c7785a1066925d5fa1b0d8)
2018-10-07 03:22:14 +00:00
loonycyborg
361c98c91c Update server to use new way of getting wesnoth version
(cherry-picked from commit 57da02a9196f6b616ade01cda3de08f2d40ba554)
2018-10-07 03:22:14 +00:00
loonycyborg
3ef2eb1ae5 server: remember client's ip in player_connections_ and use it in remove_player()
this is needed so ip is properly logged even if socket is closed or invalid

(cherry-picked from commit aaabbf2687ea0bc25dc3a9f8705fe0b6f29c1af2)
2018-10-07 03:22:14 +00:00
Severin Glöckner
2305281666 remove a duplicated space in a translatable string
...thiugh, in this case it has no effect.

[ci skip]

(cherry-picked from commit 4b7a6a98eccc07fd762ec29bcf1cd1ea84636992)
2018-10-07 03:22:13 +00:00
Charles Dang
cc3e79c0a5 Tutorial S2: made enemy starting gold equal to that of the player
[ci skip]

(cherry-picked from commit c7a06939abcc44a9f6d20d5e974ef4dc87b3e34d)
2018-10-07 03:22:13 +00:00
Gunter Labes
e4100fc3bd check for empty parameters before looping over all players
(cherry-picked from commit 0362e36305eda584d16fb89de40f9314278316e0)
2018-10-07 03:22:13 +00:00
gfgtdf
1a72f04d4a rename mp command player_version to version
(cherry-picked from commit 0853b2718d1344449a23ae68252330d457f29f3a)
2018-10-07 03:22:13 +00:00
gfgtdf
454c44f8bb add player_version mp command
to tell you what wesnoth version another player is using.

(cherry-picked from commit ba6afa4d1706a30c067a15ab26c1ab3b9ef5b87b)
2018-10-07 03:22:12 +00:00
Nils Kneuper
34fb36934e updated French translation
(cherry-picked from commit ad0b8bce8ca8d4c84dab205b6ed7608c437cd87e)
2018-10-07 03:22:12 +00:00
Nils Kneuper
a267018b2e updated Italian translation
(cherry-picked from commit 87552f083b115cabef0a4d981e4913cd7c43a15c)
2018-10-07 03:22:12 +00:00
Nils Kneuper
320b2f321f updated Chinese (Traditional) translation
(cherry-picked from commit 3a8343b4dd478497d1f2dd428e391f64b640a8b1)
2018-10-07 03:22:11 +00:00
Charles Dang
0313deefe9 Game Config Manager: handle clearing image cache in main thread
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)
2018-10-07 03:22:11 +00:00
Charles Dang
1ec69044fb Revert "Fixed an occasional crash resulting from multi-thread access of the image cache"
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)
2018-10-07 03:22:11 +00:00
Charles Dang
a5b8053340 Campaign Dialog: renamed Deterministic Mode label to "Save random seed"
[ci skip]

This better conveys its behavior, especially with the introduction of the hidden PRNG
preference.

(cherry-picked from commit bf92dbbfd2c1699a9af11e6ddc1b850e154d16f9)
2018-10-07 03:22:11 +00:00
Charles Dang
49908e5cb9 NR S10 - 14: minor cosmetic map tweaks
[ci skip]

(cherry-picked from commit 20af37d527efdd476aa96cbe57aff071bf8b7dd5)
2018-10-07 03:22:10 +00:00
Charles Dang
01d81d29ad NR S13: further reduce enemy gold
[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)
2018-10-07 03:22:10 +00:00
loonycyborg
b3bd32a936 scons: add missing winapi lib dependencies to mingw build
(cherry-picked from commit d96d5c506c2d8c8f47984b2e1d4bf13111e195a2)
2018-10-07 03:22:10 +00:00