56769 Commits

Author SHA1 Message Date
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
David Mikos
62e527c8b7 don't move health bar with unit where terrain elvation differs. 2014-05-18 15:11:50 +09:30
Chris Beck
9fd633e5da Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-18 01:08:55 -04:00
Chris Beck
a3377d6113 fixup project files after rename builder.?pp -> terrain_builder.?pp
This fixes up earlier commit 8fafdbecd42d
2014-05-18 01:07:49 -04:00
David Mikos
e92781614d smooth unit movement over terrain with elevation 2014-05-18 14:36:08 +09:30
Chris Beck
259e1f0c83 simplify implementation of read_locations, using STL 2014-05-18 00:20:19 -04:00
Chris Beck
d4df8f165a Merge branch 'map_location' 2014-05-17 21:54:48 -04:00
Chris Beck
96ba999d49 improve the performance of map_location.cpp
For two variables known to be either 0 or 1, && is faster than *.
For example && can short-circuit and * cannot in C++ afaik.
2014-05-17 21:49:20 -04:00
David Mikos
6475cd1ad2 Fix bug 22020: correct help pointer for base units with variations 2014-05-18 10:42:40 +09:30
Chris Beck
9e600ac0f6 Fix map_locations.cpp read_locations function
read_locations will no longer silently process a mismatched list of
x and y integers as a valid path, instead it will throw a
bad_lexical_cast. gfgtdf and I discussed on irc, we don't believe
that this will break save or replay compatibility, and it could
potentially help to catch possible OOS bugs in the future. I am
currently passing all my C++ and WML unit tests with this commit.

This commit also changes the [command] [move] handler over to use
this function directly without checking for mismatched lists, so
if this commit is reverted that function will still work correctly.
2014-05-17 20:13:31 -04:00
Chris Beck
3e6c6d1f16 fixup test_map_location.cpp
Was checking vector sum commutativity twice, replaced with an
anticommutativity test for vector_difference.
2014-05-17 20:06:09 -04:00
Chris Beck
39f2b669ae refactor synced_commands [move] to use read_locations, not reimpl. 2014-05-17 19:42:32 -04:00
David Mikos
d1c196cbee Remove 'allow_new_game=no' entries from random map new game list 2014-05-18 09:03:42 +09:30
Chris Beck
b242735c7e add map_location characterization tests
There is a compiler option to generate the expected output set for
the current build, see test_map_location.cpp
2014-05-17 19:19:52 -04:00
Chris Beck
afb3fec155 catch bad lexical casts (from parsing map locations from configs) 2014-05-17 19:19:52 -04:00
Chris Beck
49dc82b5d8 bad_lexical_cast derives from std::exception 2014-05-17 19:19:52 -04:00
Chris Beck
8fafdbecd4 rename builder.cpp -> terrain_builder.cpp
Since that's the class that it defines.
2014-05-17 19:19:52 -04:00
Chris Beck
43166e03c5 small refactor of strict mode logging
Move a bool flag that remembers if we threw an exception, to be a
local static variable in that function, rather than at file scope.
This ensures that no other functions will mess with it.
2014-05-17 19:19:51 -04:00
Charles Dang
4613e5a619 AOI S7: removed [ai] tag from player side 2014-05-17 18:49:35 -04:00
Charles Dang
5cc1d2f9e2 AOI S7: removed redundant difficulty-conditional recruit list 2014-05-17 18:49:31 -04:00
Chris Beck
86fea3c551 add unit test for berzerk + firststrike interaction 2014-05-16 23:53:28 -04:00
Chris Beck
4e16a998a2 refactor break_replay tests into one file 2014-05-16 22:54:03 -04:00
Chris Beck
8d161347bc refactor assert, return, two_plus_two, to each be one file 2014-05-16 22:45:54 -04:00
Chris Beck
bf2dda129c refactor sighted events test to be one file 2014-05-16 22:37:13 -04:00
Chris Beck
af4b671266 add unit test for basic unit map functionality 2014-05-16 22:23:48 -04:00
Chris Beck
d7374f4080 add test_move unit tests 2014-05-16 21:25:23 -04:00
Chris Beck
77993f9d98 fixup [command] [move] implementation
The move implementation used a function from map_location.cpp,
parse_location_range. This has the consequence that if the move tag
has mismatched numbers of entries for x and y, it is not reported
as an error and instead some truly bizarre, although not "undefined"
behavior ensues. Since this has obvious potential to conceal bugs
and no obvious benefit, I have changed this to a more sane
implementation. See chat log today with gfgtdf for full details.
2014-05-16 21:19:51 -04:00
Chris Beck
9964be2849 fixup move_skip_sighted tests 2014-05-16 20:29:26 -04:00
Chris Beck
2c486ed699 add tests of the [move] skip_sighted_option
This is partially a follow up of previous commit
403af25e9da77dbf7aa295ccd901af3bdcd6f889
2014-05-16 19:35:06 -04:00
Chris Beck
94fdab4389 add sighted events unit tests 2014-05-16 18:09:52 -04:00
Chris Beck
9df026f8e8 move test_grunt_tod_damage map to a map file 2014-05-16 17:11:27 -04:00
Chris Beck
0201fe3247 put generic unit test map in its own file 2014-05-16 17:05:31 -04:00
Chris Beck
34402b6a88 update changelog 2014-05-16 15:53:03 -04:00
Chris Beck
403af25e9d fix a bug, replace sighed -> sighted in move records 2014-05-16 15:50:26 -04:00
Ignacio R. Morelle
eb931a5ea3 Refresh team flags after using [modify_side] color= without a new flag set
Fixes bug #21867.
2014-05-16 02:30:50 -04:00
Ignacio R. Morelle
9f458d1bb2 fs: Assert that game_config::path is not empty in get_wml_location()
Let's see if this breaks some absurd border case I couldn't think of.
Quick testing revealed that early initialization, campaignd, and
wesnothd at least did not fail the assertion check.
2014-05-16 01:50:27 -04:00
Ignacio R. Morelle
314425ab0e fs: Use game data path to resolve ./ in the absence of a current_dir
Fixes a file content disclosure bug (#22042) affecting functionality
relying on the get_wml_location() function and not passing a non-empty
value for the current_dir parameter.

See <https://gna.org/bugs/?22042> for details.

This is a candidate for the 1.10 and 1.12 branches.
2014-05-16 01:50:27 -04:00
Groggy Dice
93353ee0a6 wmllint: add option to turn off missing side= key warning 2014-05-16 01:40:28 -04:00
Groggy Dice
d866189a0e wmllint: warn about no side key in [*_shroud],[gold],[modify_side/ai]
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.

Since the insertion of an attribute line is now commented out, it may be
questioned whether this still belongs in hack_syntax. However, at some
point the plan is to give users an option to insert the side= key.
2014-05-16 01:40:25 -04:00
Groggy Dice
1a794a2d1e wmllint: warn about no side key in [set/(dis)allow_recruit],[store_gold]
Those who are updating from old UMC may otherwise be caught unawares by the
change from defaulting to side 1 when the side key is missing, to all
sides. Later we will have an option to turn off this warning.
2014-05-16 01:40:23 -04:00
Groggy Dice
e3adf001a8 html.py: hone regexes for URL linking
First, a couple of extraneous quotes were left in the second regex around
"</a>".

Second, it is possible that a period or question mark could be used to end
a sentence, rather than be part of the URL. So check that these characters
are followed by an alphanumeric character to make them part of the URL.
2014-05-16 01:40:20 -04:00
gfgtdf
da388ce21a sync unit creation in [side]
especialy the traits, we use a set_random_determinstic for that.
2014-05-16 00:08:02 -04:00
Chris Beck
7b6a1ec74d fixup messed up whitespace and similar 2014-05-15 22:12:59 -04:00
Chris Beck
db08784a55 Merge branch 'master' of git://github.com/wesnoth/wesnoth 2014-05-15 11:59:14 -04:00
Chris Beck
f053667408 add option to run_wml_tests to change wesnoth binary / binary path 2014-05-15 11:58:25 -04:00
Chris Beck
4c224247ae fixup minor issues with wml test script
- Use printf for formatting when a test fails
- Rename some variables
- Make sure all variables are quoted when used
2014-05-15 11:31:54 -04:00
Groggy Dice
ec3c65d4c1 wmllint: put off dryrun's verbosity check until after options are processed
Per discussion with Elvish Hunter on the forum. Having dryrun check for a
minimum verbosity level during the options for loop meant that -vd would
set the verbosity level to 1, while -dv would set it to 2.
2014-05-15 03:53:07 -04:00
Groggy Dice
cc059b64f6 style.css: no margin-bottom for <pre> 2014-05-15 03:53:04 -04:00
Groggy Dice
65b273edb1 data/campaigns: correct "... then" to "... than"
Inspired by seeing a spelling correction by Vultraz in the logs back in
February.

Cannot be backported to 1.11 yet due to the stringfreeze.
2014-05-15 03:53:01 -04:00