56819 Commits

Author SHA1 Message Date
Chris Beck
c211bc4b7e Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-20 01:16:00 -04:00
Chris Beck
1bd43bb6a9 refactor is_observer out of check_victory
This is a minor change to victory_when_enemies_defeated condition.

Old logic: If there are no not defeated sides which are enemies
of eachother (i.e. there is still a battle going on),
BUT victory_when_enemies_defeated = false, and either we found
a not defeated local human player, or we are a multiplayer observer
(there are no locally controlled sides), then don't end the level.

New logic: If there are no not defeated sides which are enemies,
BUT victory when enemies defeated = false, and EITHER we found a
not defeated local human player, OR there is a not defeated remote
human player AND no local human side assigned at all,
then don't end the level.

I think this more precisely the behavior we want. is_observer
doesn't belong in this function, and with the introduction of
defeat_condition, UMC will pretty much always be able to get the
behavior they want, so I'm much more comfortable to introduce this
change now than I would be otherwise.
2014-05-20 01:10:31 -04:00
Chris Beck
aa83190e07 pre-empty a division by zero
(whether or not it's actually possible based on other
considerations, this is a good idea)
2014-05-20 01:00:11 -04:00
gfgtdf
8dbeefef9a rename values of [side]defeat_condition=
most likely defeat_condition= will re renamed too defeat= too.
2014-05-20 04:01:48 +02:00
Chris Beck
987e34a3e3 fixup travis unit tests
- travis runs tests not in verbose mode,
  *but* if there is a failure,
  then it runs in very verbose mode, with strict mode off, to get
  errors reported in the travis log.
- run_wml_tests points out that if you don't run in strict mode,
  some tests may not fail as expected, so the count at the end
  may differ
2014-05-19 19:14:13 -04:00
Chris Beck
3eb02d338b disable strict mode on travis, so we can see the error messages 2014-05-19 18:06:29 -04:00
Chris Beck
7046c3906e fixup map_location unit tests
update the correct test values,
and test the radial mode for characterization as well
2014-05-19 18:05:48 -04:00
Chris Beck
aace2c0288 turn on very verbose logging for wml unit tests on travis
So we can maybe see what's wrong.
2014-05-19 17:20:11 -04:00
aquileia
8136065f75 Fix readme files about unit test scenarios 2014-05-19 17:13:27 -04:00
aquileia
a69ee6e0c1 Update VC project for b4ea561e37 2014-05-19 17:13:20 -04:00
Chris Beck
cf19cc5516 get_relative_dir to use radial_symmetry mode, until we fix default
Revert this when we have fixed up the default mode.
2014-05-19 17:08:21 -04:00
Chris Beck
2a927871b7 fixup radial mode get_relative_dir 2014-05-19 17:05:21 -04:00
Chris Beck
ab29ba7e43 add map location rotate wml interface 2014-05-19 16:29:07 -04:00
Chris Beck
aaff4bdfee Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-19 14:35:42 -04:00
Chris Beck
3f5350a5ef add wml relative dir query tag, and interactive test scenario 2014-05-19 14:35:07 -04:00
gfgtdf
b258433650 Merge pull request #165 from gfgtdf/defeat_condition
replace fight_on_without_leader with defeat_condition
2014-05-19 19:58:55 +02:00
gfgtdf
87c492e0a1 don't load null hotkeys
this prevents a possible segfault because otherwise add_hotkey calls hotkey::set_scope_active(new_scope) where new_scope is SCOPE_COUNT.
2014-05-19 19:57:58 +02:00
gfgtdf
495deb0e46 Update changelog add 'defeat_condition' 2014-05-19 19:53:22 +02:00
Chris Beck
748ba751bc move default relative dir mode to .cpp file, for ease of testing 2014-05-19 12:05:18 -04:00
Chris Beck
de4caa8768 add a "radial mode" option to get relative dir. (just for kicks)
Adds a mode for get relative dir which should give radial symmetry,
using vector ops. This might be useful in some application, or to
help debug.
2014-05-19 11:43:55 -04:00
Andrius Silinskas
b4f6c6544e Minor style improvements. 2014-05-19 14:57:43 +01:00
Andrius Silinskas
d908fde2ec Always indicate that faction was chosen when placing player.
This fixes bug #21977.
2014-05-19 14:57:15 +01:00
Chris Beck
be1c1f882e fixup header to restore gcc builds 2014-05-19 01:56:37 -04:00
Chris Beck
1a1f7a5cf8 get_relative_dir may take a const & argument 2014-05-19 01:30:29 -04:00
Chris Beck
d93b01b836 Merge branch 'add_map_location_rotate' 2014-05-19 01:20:00 -04:00
Chris Beck
eba19db166 in debug mode, add team strings as well as names for hidden sides.
This brings the team names in line with the player names and other
behavior in mp_connect in debug mode. For instance there are other
lines like this:
dbf3331e9a/src/multiplayer_connect_engine.cpp (L155)

From inspecting the save files generated while testing this issue,
it's not clear if it could have actually caused a problem in game,
but it addresses an issue raised by SlowThinker on the bug tracker:

https://gna.org/bugs/index.php?21800

and does indeed fix a minor shortcoming of debug mode in mp connect
engine.
2014-05-19 01:10:00 -04:00
Chris Beck
a77ac836d3 add map_location rotate functions, and tests 2014-05-19 00:52:09 -04:00
gfgtdf
d948a04d9d rename remove_from_carryover_on_leaders_loss_
to remove_from_carryover_on_defeat_
2014-05-19 04:34:03 +02:00
gfgtdf
12d190ff9f add "always" defeat_condition 2014-05-19 04:21:52 +02:00
Alexander van Gessel
9dae74cd5d Disable some failing tests
These tests may no longer be correct. Their author is looking into them.
2014-05-19 02:33:16 +02:00
Alexander van Gessel
c3c2b25a82 Use xvfb on travis
As instructed on http://docs.travis-ci.com/user/gui-and-headless-browsers/
2014-05-19 02:32:20 +02:00
gfgtdf
26d60c0a8f replace fight_on_without_leader with defeat_condition
[side] now has an attribute defeat_condition which can be "no_leader"(default), "no_units" or "never"
"no_leader" behaves liek it behaved before.
"no_units" behaves like fight_on_without_leader=yes behaved before
"never" is new and causes the side to never get defeated, this usually means the scenariodesigner has to end the scenario with [endlevel]
2014-05-19 00:30:21 +02:00
gfgtdf
1fc27bb9e7 replace wesnoth.is_synced() with wesnoth.current.synced_state
making it a proxy field instead of a function makes it easier to use.
 Also we now return a string so the luadev can distinuish between
 'local_choice' and 'unsynced' which might be useful because [do_command]
 cannot be used from 'local_choice'.
2014-05-18 23:50:07 +02:00
gfgtdf
aed6d94820 use use_undo=false for [do_command]
...if we are already in a synced_context.

undoing usually also removes things from the replay, so we cannot undo things if the don't put things in the replay.
2014-05-18 23:02:43 +02:00
gfgtdf
71cf3e9660 devide bad_lexical_cast from std::exception 2014-05-18 22:46:11 +02:00
Chris Beck
ff00416720 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-18 13:40:09 -04:00
Chris Beck
3501d438b0 add 3-way tests for map_location, like associativity. refactor.
Tried also to assert translation invariance of get_relative_dir,
but that doesn't seem to hold atm.
2014-05-18 13:38:20 -04:00
gfgtdf
ff3b68636e expose side.lost and fight_on_without_leader to lua 2014-05-18 19:34:34 +02:00
gfgtdf
7390a991d7 add setter for team.fight_on_without_leader
to be able to set this value from lua.
2014-05-18 19:31:40 +02:00
Mark de Wever
ede743d4aa Only blit neutral surfaces.
On the Mac loaded images are not in the neutral format causing rendering
glitches when using blit_surface using these images. Test and when
needed convert the image before using it.

Fixes bug #22045.
2014-05-18 18:01:41 +02:00
Chris Beck
bf1dbe2b13 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-18 11:22:22 -04:00
Chris Beck
f9acf4d957 Move legacy map_location arithmetic to terrain_builder.cpp
This is the only place where it is now used, so we move it out
of the map_location.?pp files and into the private space of
terrain_builder.cpp
2014-05-18 11:21:28 -04:00
mattsc
b9a86a656a Update Xcode project 2014-05-18 07:01:01 -07:00
Chris Beck
9f8dfc3819 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-18 08:18:40 -04:00
Chris Beck
14c8b47287 disable the get_relative_dir visualizer 2014-05-18 08:18:14 -04:00
Chris Beck
70f4ccb545 Merge branch 'test_relative_dir' 2014-05-18 08:12:54 -04:00
Chris Beck
0e1963559a update characterization test for get_relative_dir 2014-05-18 08:11:53 -04:00
David Mikos
ad8b0da265 Fix code comment with last commit 2014-05-18 21:37:29 +09:30
David Mikos
829b74c2be Fix implementation of map_location::get_relative_dir 2014-05-18 21:16:56 +09:30
Chris Beck
741051b0b3 add sanity check for get_direction
check that it corresponds to adding vectors of length one
2014-05-18 06:03:32 -04:00