After other refactors, this variable is basically useless -- it
is only used in one function, and indicates to that function if
we called it from the normal sp path, or the mp linger code path.
We choose to replace it with the linger_ variable -- the sp code
path will never follow to this function if linger_ is true, and
if it did it would cause a serious error anyways and corrupt
replays, so we would know if this was happening. So this is a
strict refactor.
end_turn_record and end_turn_record_unlock are only used in one
place, and in succession. We delete them and paste the definitions
inline, which permits some simplification. This is a strict
refactor.
fixup end of scenario saves
iceiceice writes: does anyone know why we have this line?
https://github.com/wesnoth/wesnoth/blob/master/src/play_controller.cpp#L752
it causes end of scenario saves to be stripped of all units
my theory is that it was for some point in time before carryover was implemented properly
i propose to remove it in 1.12 and master
AI0867 writes: See commit aa2cf7d.
Looks like the carryover refactoring might have made it do the opposite of what it used to.
Testing reveals that this line cannot be removed without breaking
reloads of disconnected games (with uninitialized sides). But, the
argument should be "false" since this is not called from the replay
codepath.
All of before_human_turn, play_side, play_turn had an argument
"bool save". The only use of this was by the playsingle controller
to determine whether or not to save an autosave -- it was controlled
in a single place by a single for loop in play_scenario.
Instead of polluting all of these functions, including play_controller,
and replay_controller, with arguments that they ignore, save was
replaced with a member variable of playsingle_controller. This is a
strict refactor in terms of behavior.
maybe_do_init_side and do_init_side both required a team_index
argument, which was always player_number_ - 1, (checked this with
assertions and playtesting), and which was available in the class
which defined them
this is intended to fix
1) an error messages in stderr when reloading a game related to
synced_context: (the original game called random ... times ...)
2) reloading a save with init_side_done = no
This was buggy and based on deprecated SDL features that will not
continue to be available. aquileia wrote us a very nice windows
port of the run_wml_tests bash script, so for windows mac and
linux we should now be able to run the unit tests as desired.
Maybe someday built-in timeouts can be supported using boost
process library, if that ever materializes.
Add support for WML unit tests to the VC compiler, and also a nice windows cmd script, porting the bash script which we have, and which uses a timeout program which Aquileia wrote for us and added to the VC project files.
As the --timeout option for Wesnoth can stall the process, we replace it
by an encapsulation comparable to the Unix timeout function.
WindowsTimeout isn't limited to Wesnoth, it can in fact set a timeout for
any executable called through it.
An example on the use of these WinAPI functions can be found on
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682512.aspx
it seems like my compliler sometimes includes windows headers even before we define UNICODE in windows_tray_notification.hpp so the UNICODE define has no effect. Most likeley this is more an issue with strange local compiler adjustments than with the c++ code. This fixes it too.
Now the game ends on all client at the same time even with victory_when_enemies_defeated_= no.
previously in mp the attribute victory_when_enemies_defeated only prevents victory for human sides but doesn't prevent defeats. This means in a simple 1vs1 Mp game with victory_when_enemies_defeated=no when side 1 gets defeated, Player 1 will get the "You have been defeated" message and for client 2 the game continues. I tested with adding victory_when_enemies_defeated =no in 2p_Arcanclave_Citadel.cfg.
When side 1 looses (leader killed) (during side 2' turn) the following happens:
[list=1]
[*]side 1 gets a "you get defeated", side 2 continues
[*]when side 1 checks "end scenario" side 2 gets a "side 1 has left the game... reassign controll to ai/human/idle/..."
[*]I clicked "controll by human" on client 2
[*]I ended side 2's turn and continued playing side 1 on client 2 and didnt get defeated
[/list]
I am sure that this is not the intended behaviour.
this commits also effects when "enemies defeated" is fired accodignly so it is fired on all clients at the same time like any synced event.