57238 Commits

Author SHA1 Message Date
gfgtdf
14437136a9 go to next scenario if there is at least one human
defeated sides in mp now also advance to the next scenario if there is
at least one networked human side that got a victory.
2014-05-31 14:58:11 +02:00
Mark de Wever
af98cf1781 Remove some useless casts. 2014-05-31 13:56:46 +02:00
Chris Beck
eb18ffc8a8 clean up find_human_team_before function
This is a strict refactor.
2014-05-30 22:21:59 -04:00
Chris Beck
d86ff4d650 eliminate unnecessary argument in play_controller
This is a strict refactor within the parameters of the program.
2014-05-30 22:18:48 -04:00
Chris Beck
ef5417f60f remove unnecessary variable "turn_over_" from play_controllers.
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.
2014-05-30 21:19:19 -04:00
Chris Beck
b809585ca2 eliminate archaic functions
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.
2014-05-30 21:05:16 -04:00
gfgtdf
881e2da2d1 remove dead code.
player_cfg_ was always NULL.
2014-05-31 02:16:44 +02:00
Chris Beck
1a7d358e39 Merge pull request #174 from cbeck88/fixup_end_of_scenario_saves
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.
2014-05-30 19:32:57 -04:00
Chris Beck
18a0bc3b77 fixup 77ead906927bec69d9136d349d637458f7a553f0
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.
2014-05-30 17:10:26 -04:00
gfgtdf
ee89299987 fix player_type_changed durign ai turn
it is possible that we receive a player_type changed during an ai turn.

especialy this fixes :droid
2014-05-30 22:19:42 +02:00
gfgtdf
2999dab6e4 remove outdated code
this check was introduced in b1c76bcb5b8dabf8fe5044698760114e6360d4ea (2003) when this codepath also handled replays.
2014-05-30 19:16:42 +02:00
Boldizsár Lipka
aa9c6b5feb Re-add two ctors removed by mistake. 2014-05-30 12:18:25 +02:00
Chris Beck
15e81134fb remove unnecessary arguments
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.
2014-05-30 00:45:05 -04:00
Chris Beck
19b381b560 fix gcc compilation 2014-05-29 23:45:17 -04:00
Chris Beck
ea600928ec update changelog 2014-05-29 23:04:20 -04:00
Chris Beck
2a22efb646 [modify_side] may now set defeat_condition attribute
This was an oversight that missed release 1.11.15.
2014-05-29 23:01:45 -04:00
Chris Beck
890f6f0fce remove more unnecessary arguments, from play_controller::play_side 2014-05-29 22:12:16 -04:00
Chris Beck
1e4858fa4a remove unnecessary arguments
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
2014-05-29 21:34:09 -04:00
Chris Beck
bf0fca4d83 assert that do_init_side functions are never called with bad arg 2014-05-29 20:43:44 -04:00
Chris Beck
0af672c5b7 remove unnecessary virtual qualifiers 2014-05-29 20:01:03 -04:00
gfgtdf
e50a7785fd fix reloading
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
2014-05-30 00:59:45 +02:00
gfgtdf
b6efcec496 fixup 28ffcc54483942c598d24cecd4f65534f0185c51
I didn't see that store_carryover(state_of_game, playcontroller, disp, end_level); uses end_level.
2014-05-29 22:27:50 +02:00
gfgtdf
28ffcc5448 use config::child_or_add 2014-05-29 22:15:46 +02:00
Boldizsár Lipka
7684fe06fe Add a lot of functions to sdl::ttexture. 2014-05-29 23:50:33 +02:00
Mark de Wever
5cfd93488b Implement the SDL2 text input event in GUI2.
This enables text editing in the GUI2 widgets.
2014-05-29 20:45:11 +02:00
Chris Beck
c8699e2f05 remove built-in wesnoth timeout
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.
2014-05-29 14:21:44 -04:00
ln-zookeeper
bab0915c94 Prevent allied leaders' suicidal behavior 2014-05-29 20:29:04 +03:00
ln-zookeeper
cf3699dabd Prevent allied leaders' suicidal behavior 2014-05-29 19:56:03 +03:00
Chris Beck
38211c1036 fixup end of scenario saves 2014-05-29 12:38:56 -04:00
Chris Beck
c663cdcaba remove code made dead by commit d808b7c7874465e314c433029d709236bea4fab9 2014-05-29 12:31:10 -04:00
Chris Beck
c084098556 add const qualifier to unit_map::has_unit, which was missing it 2014-05-29 12:16:11 -04:00
Mark de Wever
abee16b16e Convert the GUI2 text API to take strings.
This change makes it easier to use the SDL2 text input events.
2014-05-29 16:32:14 +02:00
Mark de Wever
b3403e29e8 Disable the unicode for SDL2 key events.
The values are wrong so disable them for now.
2014-05-29 16:26:38 +02:00
Mark de Wever
81debc2fdb Update formatting. 2014-05-29 16:08:22 +02:00
Elvish_Hunter
e3fc8f13b8 wmllint gui: made some options in the wmlscope tab evenly spaced 2014-05-29 14:57:10 +02:00
Elvish_Hunter
5480cca466 wmllint gui: fixed a bug in regexp handling 2014-05-29 14:57:09 +02:00
Chris Beck
8306aa9353 Merge pull request #173 from aquileia/WML_test
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.
2014-05-29 01:31:37 -04:00
gfgtdf
0ea2ef4821 remove outdated code.
this was forgotten in e80fc181aea84ec9a0b26c61ed49c18a3410143d
2014-05-29 04:44:03 +02:00
gfgtdf
dce39b93e1 add maybe_linger to playsingle/mp_controller 2014-05-29 04:21:55 +02:00
gfgtdf
73de2e684a move is_host_ to playturn.hpp 2014-05-29 04:07:36 +02:00
aquileia
64d72a63a9 Windows WML tests: Enable automatic tests in VC 2014-05-29 02:52:34 +02:00
aquileia
412aca56d7 Windows WML tests: Add optional argument for executable path 2014-05-29 02:52:27 +02:00
aquileia
f90569ccee Windows WML tests: Improve stdout output
Differentiate between timeouts and real errors: In case of a timeout, only
throw a warning instead of an error.

Also implement a basic progress bar.
2014-05-29 02:52:24 +02:00
aquileia
8d91cef488 Windows WML tests: Port .sh test script to .cmd
WML tests are read from wml_test_schedule, executed and their error code
is compared to the expected result.
2014-05-29 02:52:20 +02:00
aquileia
4832724565 Windows WML tests: Add WindowsTimeout project
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
2014-05-29 02:52:16 +02:00
gfgtdf
472c0cda45 use windows unicode functions explicitly
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.
2014-05-29 01:38:46 +02:00
gfgtdf
d808b7c787 Update check_victory
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.
2014-05-28 23:58:39 +02:00
gfgtdf
59880e984b sync random_start time the normal way
we now use the deterministic rng which we also use for start unit unit
traits.
2014-05-28 21:04:07 +02:00
Chris Beck
55addc2999 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-28 12:49:32 -04:00
Chris Beck
de55f1dfc7 increase coverage of reachability tests, and rebuild answers 2014-05-28 12:49:07 -04:00