Commit graph

33042 commits

Author SHA1 Message Date
Jyrki Vesterinen
94b69e0281 Fix #2602: music doesn't change immediately on loading a save 2018-06-05 08:38:57 +03:00
loonycyborg
4eea1b5f0d wesnothd: restore lan server auto-shutdown functionality 2018-06-04 16:38:42 +03:00
loonycyborg
0714d488bc wesnothd: restore functionality to log stats every 5 minutes 2018-06-04 14:36:48 +03:00
loonycyborg
57da02a919 Update server to use new way of getting wesnoth version 2018-06-04 13:21:20 +03:00
loonycyborg
aaabbf2687 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
2018-06-04 13:16:58 +03:00
Gunter Labes
0362e36305 check for empty parameters before looping over all players 2018-06-04 06:08:01 +11:00
gfgtdf
0853b2718d rename mp command player_version to version 2018-06-04 06:08:00 +11:00
gfgtdf
ba6afa4d17 add player_version mp command
to tell you what wesnoth version another player is using.
2018-06-04 06:07:59 +11:00
Charles Dang
011cbfe3b8 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.
2018-06-03 05:21:02 +11:00
Charles Dang
b8ad791a1d Revert "Fixed an occasional crash resulting from multi-thread access of the image cache"
This reverts commit 6d0b7c8424. 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).
2018-06-03 05:20:43 +11:00
gfgtdf
575e104ca5 fix possible 'manditory child missing' when loading mp campaign games
the error could happen a soon as you advance to the next scenario if you reload a campaign save from another player.
2018-06-01 12:54:03 +11:00
loonycyborg
d35f22e077 scons: fix issue #3132 2018-05-31 19:50:08 +03:00
Charles Dang
2503ac8897 MP Lobby: added translation hints for C/S markers 2018-06-01 02:00:22 +11:00
gfgtdf
9cc32ebc46 wb: fixup "fix incorrect handling of skirmisher." 2018-06-01 01:58:27 +11:00
Charles Dang
3d8d38983d MP Staging: removed gender tooltip (resolves #2998)
I had only added it originally in case someone didn't know the symbols offhand,
but sevu is right that they can get a bit annoying.
2018-05-31 19:41:28 +11:00
Charles Dang
6cc91794f5 MP Lobby: display self before friends in player list (fixes #3185) 2018-05-31 19:41:27 +11:00
gfgtdf
0dd382eab3 fix seed not resetting in lua mapgen. 2018-05-31 19:21:57 +11:00
gfgtdf
84d94ca305 add mapgen debug info. 2018-05-31 19:21:56 +11:00
gfgtdf
8e3ee5c597 add mapgen debug info. 2018-05-31 19:21:24 +11:00
gfgtdf
f69af8533a add mapgen debug info. 2018-05-31 19:21:23 +11:00
gfgtdf
af6559af75 fix unit filter always evaluating [and] even if it is not needed. 2018-05-31 19:21:23 +11:00
Charles Dang
8c3673dfa0 GUI2/Chatbox: removed spurious newline from initial PM notice 2018-05-31 19:20:31 +11:00
Charles Dang
aad64d72cf Made vgettext/vngetext internals harder to use accidentally (resolves #2716)
Also removed the two implementation function overloads that did not take a textdomain.
2018-05-30 15:15:34 +11:00
Charles Dang
a08af0c1da Fixup cc2cc29 2018-05-30 13:57:37 +11:00
Charles Dang
569d86277a GUI2/Dispatcher: added a connect_signal convenience wrapper for draw callbacks
Didn't use this in the window widget since that doesn't specify front_child as
the queue position. I need to evaluate whether draw callbacks need to be in that
position anyway. AFAIR I only started adding them there since I noticed the one
in the debug clock dialog used that.
2018-05-30 12:15:57 +11:00
Charles Dang
31c4d09528 GUI2: praise auto 2018-05-30 12:15:57 +11:00
Charles Dang
cc2cc29376 Deployed std::make_unique and std::make_shared in more places 2018-05-30 12:15:56 +11:00
Charles Dang
4b03168fec Fixup f72f89f 2018-05-29 21:11:57 +11:00
Charles Dang
eddbaa2159 Events: minor cleanup 2018-05-29 21:01:17 +11:00
Charles Dang
f72f89f4d5 Campaign Difficulty: consolidated both lines into a single label 2018-05-29 21:00:34 +11:00
Charles Dang
6d0b7c8424 Fixed an occasional crash resulting from multi-thread access of the image cache
This was a problem as of 52db950e94 since the loading
screen could access the image cache while the worker thread cleared it.
2018-05-29 14:00:47 +11:00
Jyrki Vesterinen
472b0cbbfb Fix #3042: attack prediction gives wrong results for HP <= 0 units
One_strike_fight() assumed that if HP distribution hadn't been calculated,
the unit is alive. It would normally be a valid assumption, but the Wesnoth
engine allows units with negative HP (although things aren't guaranteed to
work correctly in the presence of such units).

The assumption, together with a completely wrong calculation for the
probability that the opponent will counterattack, resulted in badly
incorrect results. That, in turn, caused the calculated probability that
the opponent to kill us to become negative (I observed -75 % when
debugging), making the calculated probability to be poisoned/slowed to
exceed 100 %, and that finally caused an assert if the AI simulated another
fight for the same unit.

I have now fixed those issues. I also noticed that rounding error allowed
the probability to be killed to still become slightly negative, and thus
changed std::min() to utils::clamp() to limit the value to the allowed
range.
2018-05-28 22:13:37 +03:00
Jyrki Vesterinen
0200487aad Revert "Disallow units with negative HP"
This reverts commit ef60deaa2b.

@ln-zookeeper pointed out that units with negative HP are documented in
the wiki, and thus disallowing them is an API
change.
2018-05-28 22:12:33 +03:00
Jyrki Vesterinen
050bb3fa2c Revert "Allow modifying dead units in last_breath and die event handlers"
This reverts commit 15446acb2a.
2018-05-28 22:12:22 +03:00
Jyrki Vesterinen
58dca3a884 Revert "Throw a Lua exception when creating a negative-HP unit in a Lua context"
This reverts commit 258a0e4689.
2018-05-28 22:12:08 +03:00
Jyrki Vesterinen
70be1d2932 Revert "Allow modifying dead units in more event handlers"
This reverts commit 9110e49760.
2018-05-28 22:11:55 +03:00
Charles Dang
019848a28f Events: removed unused sdl_handler virtual functions
volatile draw had to do with drawing map labels pre-accelerated rendering. They're unused
now and I don't foresee using them again since they don't offer anything the regular draw
functions don't and they aren't needed for the map labels anymore.

Tooltips are handled by handled by GUI2. There are no more help strings since the related
interface in CVideo got removed.
2018-05-28 17:40:37 +11:00
Charles Dang
3c4da4035f Fixup 40d9b99 again (more unused variables) 2018-05-28 16:44:37 +11:00
Charles Dang
3cc8544488 Fixup 40d9b99 (unused variables) 2018-05-28 16:12:00 +11:00
Charles Dang
40d9b9953b Cleaned up some unused stuff from the display class
Namely complete_redraw_event(), recalculate_minimap(), and redraw_minimap(). I had
been keeping the last around for reference (see f5ec886cb5) but I
figure it's not really worth it since this isn't the drawing method we'll want to
be using in the end anyway.
2018-05-28 15:14:39 +11:00
Charles Dang
ed8a8a48f7 Used std::string::front() and back() in more places 2018-05-28 15:14:37 +11:00
Charles Dang
c5ba6f01a8 Cleaned up utils::apply_modifier a bit 2018-05-28 15:14:36 +11:00
Celtic Minstrel
d03829dfd0
Fixup previous commit
Accidentally removed the third parameter for `increase_movement` instead of `increase_accuracy`. Whoops!
2018-05-27 11:27:58 -04:00
Celtic Minstrel
1413dfd4f3
Fix effects being unable to decrease weapon parry/accuracy
fixes #3181
2018-05-27 10:33:44 -04:00
Charles Dang
8ecbed0205 Fixed CVIdeo::quit being swallowed in invoked_function_data::call 2018-05-27 22:22:42 +11:00
Charles Dang
5588588b55 Fixup 86792656ae (re-add ctor) 2018-05-27 22:02:57 +11:00
Charles Dang
86792656ae Handle exceptions thrown by call_in_main_thread in the caller thread
Also removes an unnecessary ctor and adds docs.
2018-05-27 17:36:29 +11:00
Charles Dang
99c2ed8f65 MP Staging: simplify a call 2018-05-27 03:04:09 +11:00
Charles Dang
050430460a Moved faction sorting from the FLG manager to the connect engine
This list in the connect engine was passed to each of its side engine's flg managers,
where it was then sorted by update_choosable_factions(). Basically, a whole bunch of
unnecessary sorting. This makes it so the list is already sorted when it's passed to
each side engine.

None of the post-processing of the faction list (in populating available_leaders_)
should mess with the order, as far as I can tell.
2018-05-27 03:04:08 +11:00
gfgtdf
0c3ca19e9d remove useless code in unit::advance_to
the line above does exactly the same as the line inside that if(){..} so it has no effect.

Also, what the comment says is wrong. We do not want to keep the old recall cost if it is different from the original recall cost because  doing that would break removing objects that change recall cost.
2018-05-26 23:58:11 +11:00