57054 Commits

Author SHA1 Message Date
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
Alexander van Gessel
a4e30b6275 Fix a wmllint crash 2014-05-28 17:54:49 +02:00
Chris Beck
6c55e29a93 Merge branch 'pathfinding_tests' 2014-05-28 01:31:42 -04:00
Chris Beck
3a102774b5 fixup pathfind tests, add reachability tests 2014-05-28 01:31:09 -04:00
gfgtdf
5d53e2714d fixup build
the test files aren't included in my local build so i didn't notice.
2014-05-28 05:32:56 +02:00
gfgtdf
84556b11fc remove num_turns parameter
this was always equal to level["turns"].to_int(-1) so i replaced it with that.
2014-05-28 04:31:20 +02:00
gfgtdf
f7f914c84f Update tod_manager.cpp
simplifies code.

the next step should be removing the "const int num_turns" parameter and using scenario_cfg["turns"] instead.
2014-05-28 04:00:24 +02:00
Chris Beck
6cb367594b test [store_locations], and try to characterize [find_path] 2014-05-27 20:30:30 -04:00
gfgtdf
4eb40973dd fix indention & remove commented out code 2014-05-28 00:48:40 +02:00
gfgtdf
3b66f52298 fix skip turn when a side has no units
the previous implementation didn't fire "side turn end" events in this case.
2014-05-28 00:40:19 +02:00
gfgtdf
28bfa6037c optimize minimap.cpp 2014-05-27 21:48:28 +02:00
Chris Beck
e5015214d0 fix bug in [wml_message] which caused wml errors not to be flushed 2014-05-27 15:26:00 -04:00
gfgtdf
8a95d36c61 optimize minimap.cpp
by moving a call out of the loop.
2014-05-27 21:05:47 +02:00
Chris Beck
cad6edf182 add comment to test_relative_dir.cfg 2014-05-27 12:00:30 -04:00
Alexander van Gessel
4d7de12e47 Unit tests for deterministic unit facings 2014-05-27 17:30:13 +02:00
Alexander van Gessel
311d7bad80 Make recruit facing direction deterministic
This commit borrows ideas from PR #29

If there are enemies, face towards the closest one (with distance reduced by enemy level)
If you have a leader, face away from him.
Otherwise, face towards the center of the map.
2014-05-27 17:29:07 +02:00
Alexander van Gessel
d8cd6be83c Add _" and " between shared weapon effects. 2014-05-27 15:01:06 +02:00
Alexander van Gessel
038ff82a02 Test case for two interface bugs
An effect that does more than one thing concatenates the descriptions.
The effect description isn't updated when a new weapon which it affects
is added to the unit.
2014-05-27 14:58:43 +02:00
Alexander van Gessel
e701fe68b0 Move animationless moving unit hiding to a more appropriate place
Unit hiding is usually done in replace_temporary, which is called by
proceed_to. As proceed_to exits at the beginning if animate is false, this
would seem like a good place to hide the unit, but it is also unhidden during
this function. This means that was_hidden_ is set multiple times, with the
second time overwriting it with the temporary state of being hidden.
As animate remains false for the entire lifetime of the unit mover, we hide it
at the start and let finish unhide it again.

Reported at http://r.wesnoth.org/p570866
2014-05-27 13:47:47 +02:00
Chris Beck
30c179b92d refactor enum casts: prefer lexical cast default and cfg["x"].str() 2014-05-27 03:44:23 -04:00
Chris Beck
991d334388 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-26 23:35:14 -04:00
Chris Beck
f664b4e5af add test of [modify_unit] facing= attribute 2014-05-26 23:34:48 -04:00
gfgtdf
0f5dc4febb Merge branch 'master' of https://github.com/wesnoth/wesnoth 2014-05-27 04:25:36 +02:00
gfgtdf
e80fc181ae simplfy the use of turn_info
recreating this object has no effect besides send_data so i replaced
recreating with calling send_data.
2014-05-27 02:53:30 +02:00
gfgtdf
c621bfde14 remove turn_info::team_num_
it's not used anymore.
2014-05-27 02:15:23 +02:00
Chris Beck
b272239ea9 add replace_schedule in prestart test 2014-05-26 20:14:16 -04:00
Chris Beck
254c38e9af Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-26 20:02:27 -04:00
Chris Beck
ec5ec4fb38 add tests of modify_turns tag 2014-05-26 20:02:05 -04:00
gfgtdf
d28a1d6563 Merge branch 'master' of https://github.com/wesnoth/wesnoth 2014-05-27 01:11:08 +02:00
gfgtdf
562e1edd00 remove do_replay s side parameter
and use controller->current_side() instead.
2014-05-27 01:10:30 +02:00
Chris Beck
0c504c5434 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-26 19:08:06 -04:00
Chris Beck
7cc62266e9 unit tests for giving gold in prestart 2014-05-26 19:06:00 -04:00
gfgtdf
52f271a390 use turn_info_send in play_idle_loop 2014-05-27 00:50:32 +02:00
gfgtdf
12f117400c use turn_info_send in play_human_turn 2014-05-27 00:44:26 +02:00
gfgtdf
8282b1b0d6 add turn_info_send class 2014-05-27 00:42:09 +02:00