Commit graph

33042 commits

Author SHA1 Message Date
Charles Dang
ba150c0298 AI: deployed std::make_shared in a whole bunch of places
Also simplified a few instance of shared_ptr assignment. No need to create a temp ptr
just to immediately assign them.
2018-04-29 06:09:51 +11:00
Charles Dang
1e846aced2 AI: deployed typesafe_aspect_ptr consistently
No reason this couldn't have used aspect_type<t>typesafe_ptr before, so this just
makes uses of this specific type easier to find.
2018-04-29 05:58:44 +11:00
Charles Dang
1b8bfa6ab4 AI: simplify some typedefs with template aliases 2018-04-29 05:53:41 +11:00
Charles Dang
78e8ac51d7 Fixed Boost header deprecation warning on 1.67 and later
Also removed one unnecessary inclusion of the header of the same.
2018-04-29 05:34:56 +11:00
Charles Dang
1af08fb58e AI/Game Info: formatting/forward declaration cleanup 2018-04-29 05:25:36 +11:00
gfgtdf
41d7df970c fix segfault on area= filter.
areas_ might be empty, so areas_[0] might crash, also returning areas_[0].hexes didn't really make sense in the first place
2018-04-28 13:07:28 +02:00
Gregory A Lundberg
092f8f325c
Fix doccomment error
Remove lame doccomments.
2018-04-27 23:17:56 -05:00
gfgtdf
15c331281f editor: don't write default values when saving a scenario 2018-04-27 21:45:44 +02:00
Iris Morelle
ae5ab22b1a gui2/log_settings: Permit disabling logdomains (log level -1) 2018-04-27 01:52:40 -03:00
Charles Dang
6dfb87103c Made use of config_attribute_value::to_time_t 2018-04-27 13:15:07 +11:00
Charles Dang
f5626ddc30 Campaignd: made use of vector::at
This work since vector::at throws if i < size(), and the current check was for
> size() - 1, which equated to >= size(), which is equivalent to not < size().

It does lose the error message, though.
2018-04-26 20:55:45 +11:00
Charles Dang
9c5ec1c3b7 Better cordoning off of translation completion filtering 2018-04-25 16:58:37 +11:00
Charles Dang
6d09f702a5 Fixup 301fb93 2018-04-25 16:31:57 +11:00
Charles Dang
301fb933ac Cleaned up language completion filtering, but left it disabled here
We don't want this enabled on the dev branch.
2018-04-25 16:13:12 +11:00
Charles Dang
6eab44c4f3 Added and made use of a move ctor in battle_context
(and emplace_back). No reason to use the copy ctor in these cases.
2018-04-25 15:45:52 +11:00
Jyrki Vesterinen
4c258ff550 Show chat logs (excluding lobby) also in MP Join Game 2018-04-24 19:29:53 +03:00
Jyrki Vesterinen
d628a73fab Hide lobby chat log in MP staging screen
Because updating and sending messages to lobby in staging screen hasn't
been implemented, showing lobby history there would be confusing
(it would look as if everyone had stopped talking).
2018-04-24 19:19:17 +03:00
Charles Dang
098bc1c0e8 Unit/Race: made use of std::array 2018-04-24 16:35:28 +11:00
Charles Dang
d2b3a25b9e Unit/Race: formatting cleanup 2018-04-24 16:05:05 +11:00
Charles Dang
c7b8694370 Unit: replace unit_ability_list::push_back with an emplace_back impl 2018-04-24 15:28:43 +11:00
Charles Dang
1749de1521 Units/Attack Type: moved the specials_context_t ctors to the more relevant file 2018-04-24 15:01:28 +11:00
Charles Dang
a1c440510c Unit/Attack Type: formatting cleanup 2018-04-24 14:57:40 +11:00
Charles Dang
0cdcfac5d3 Unit/Animation: emplace_back (mostly) ahoy
Three cases could not use emplace_back since the ctor they use is private... :(
Which sucks since unit_animation looks like it'd be a bit expensive to copy.
2018-04-24 14:56:54 +11:00
Charles Dang
17da211d1f Fixup 1942627 2018-04-24 03:49:33 +11:00
Charles Dang
1942627052 Some refactoring of preferences-related hotkey info storage (fixes #2953)
This commit does a few things:

First, it moves the hotkey category names out of the preferences dialog and into
the more appropriate hotkey file. Each name is now properly mapped to its corresponding
category enum, so we don't have to worry about that anymore.

Second, it adds a new mapping of hotkey categories to commands so one can easily fetch
a list of hotkeys in a given category.

Third, it excludes categories with no hotkeys from the filter dropdown in the Prefs
dialog (this is the part that actually fixes the bug above).

This also includes a slight behavior change to hotkey type filtering. Previously, if a
hotkey's category didn't match any of the ones listed in the dropdown, that hotkey's
row visibility would be set to the toggle state of the first row in the filter dropdown.
Now it gets set to false.
2018-04-24 03:36:20 +11:00
Jyrki Vesterinen
4d569815d0 Fix rare crash in AI code
Reported in https://forums.wesnoth.org/viewtopic.php?p=626344#p626344

Regression from commit a3d5b9d603.

The crash occurred when
* the attacker had only one weapon
* the said weapon was disabled, and
    - the defender had no weapons
    - the defender had only one weapon, or
    - all defender's weapons were disabled
2018-04-23 19:30:55 +03:00
loonycyborg
10122057e6 wesnothd: refuse to send whispers from observers to players in same game
wesnothd <= 1.12 did this too, this restores old behavior
2018-04-23 14:11:12 +03:00
Charles Dang
1f319e31fe Label Settings: minor code cleanup 2018-04-23 12:35:02 +11:00
Charles Dang
38e0b83cda Label Settings: formatting cleanup 2018-04-23 12:35:01 +11:00
Victor Sergienko
16cd19873d #2782 Crash when using composing like ˇ and ' in lobby on macOS.
Some backstory: https://github.com/wesnoth/wesnoth/pull/2644#issuecomment-382298822
2018-04-22 01:04:55 +11:00
Gunter Labes
616fdf3498 Detect disconnect when waiting on data from server
Fixes issue #2927.
Also shows that issue #2925 still results in a disconnect but the client
does not get stuck anymore at least.
2018-04-21 15:28:38 +02:00
Gunter Labes
6dd3223249 Fix debug message
This outputs the config not the number of read bytes.
The recv_queue_.back() call was also missing lock protection.
2018-04-21 15:28:37 +02:00
loonycyborg
99372123da wesnothd: always wait for next login attempt after login fail 2018-04-21 15:57:53 +03:00
Charles Dang
2ec5c6ee5c Cleaned up more unnecessary includes 2018-04-21 23:19:55 +11:00
Martin Hrubý (hrubymar10)
783738b2f5 Remove rest of Growl things which I forgot before 2018-04-21 13:06:08 +02:00
Charles Dang
f8b936c2d5 Revert "Attempt to fix infinite loading screen if server restarts during MP login"
This reverts commit 8a00056a22. This fix did not work,
and there's a proper one on the 1.14 branch that needs to be forward-ported
(a3243bb535).
2018-04-21 20:39:36 +11:00
Charles Dang
7241561554 Animated: simplified template stuff
Just... why was T_void_value a thing.
2018-04-21 16:04:16 +11:00
Charles Dang
8a00056a22 Attempt to fix infinite loading screen if server restarts during MP login
See #2927.
2018-04-21 14:12:25 +11:00
gfgtdf
3797837c74 fix handling of no_leader= (again)
previously, if people wanted to make use of mp leader selection in mp
campaign they had to sxplicitly set no_leader=no and faction_lock=no,
with the new code its clear that no_leader= is just an alias for
faction_lock with type
2018-04-21 04:29:33 +02:00
Charles Dang
d6718cd1f9 Cleaned up game_board.hpp and some related includes
Includes a minor cleanup of the Game Stats dialog to not use a game_board reference.
Dunno why I was taking a game_board reference in the show() function anyway... the
class held a display_context reference and didn't use any functions exclusive to
game_board.
2018-04-20 17:36:27 +11:00
Charles Dang
e05b1368ad Used display_context::get_team in a few places I missed 2018-04-20 17:23:03 +11:00
Charles Dang
4818312150 Display: renamed get_disp_context to current_display_context
This is to avoid confusion with filter_context::get_disp_context. display used to
inherit from filter_context, but that was refactored out a while back. I left
get_disp_context since it was used and useful, but I realize now it causes more
confusion than not.

Also converted help::load_terrain_types_data to use get_map() directly since I
noticed it.

And changed a stray use of `thedisp` to `disp` in unit_drawer. Doesn't do anything
but it was bugging me.
2018-04-20 17:00:40 +11:00
Charles Dang
a532cc4689 Unit/Abilities: formatting cleanup 2018-04-20 16:37:08 +11:00
Charles Dang
7e442cbb54 Units: refactor display_context parameter out of ability functions
This was essentially only needed for the affects_side() helper. THAT'S IT. All this code just for
one single line... Anyway...

Utilized the display singleton's display_context getter instead. This also means fewer explicit
uses of resources::gameboard as the display_context object, meaning more compatibility with the
editor (not that that's relevant for most of the changed usecases, such as the AI, but it does
affect unit::get_abilities, which might be useful there in the future).

This also removes the display_context parameter from unit::invisible() since it was only passed to
unit::get_ability_bool().

unit::is_visible_to_team() also had its display_context parameter removed. It was used once as an
argument for invisible() and the other case was replaced with display::get_map().
2018-04-20 16:06:19 +11:00
Charles Dang
882aba3349 Units/Display: minor code cleanup 2018-04-20 15:28:42 +11:00
Charles Dang
c7ad8153c7 Units/Display: formatting cleanup 2018-04-20 15:17:49 +11:00
Charles Dang
dab8498f97 Wesnothd/Player: removed unused selective_ping member 2018-04-20 14:36:08 +11:00
Charles Dang
b81a702cfa Removed unused Ping Timeout preference
It no longer had any effect. The selective_ping flag is set was ignored by the
server since it now utilizes TCP keepalive.
2018-04-20 13:07:36 +11:00
Charles Dang
e583c470be Display: cleaned up overlay map getter interface
Instead of a pointer to a member of a derived class, used a virtual function implemented
in both derived classes (game_display and editor_display) that return an reference to the
appropriate object.

Also removed the overlay.hpp include from display.hpp. We can forward-declare the overlay
struct.
2018-04-20 10:48:39 +11:00
Severin Glöckner
f0f664b636 Fix misplaced </span> tag 2018-04-20 01:31:28 +02:00