51709 Commits

Author SHA1 Message Date
Matthias Schoeck
b8f8677238 Fix a typo in the code (accidentally used 'and' instead of '&&') 2013-01-20 21:04:00 +00:00
J. Tyne
7bd9b7a056 Some readability and robustness changes to how unit_types are built.
(No functional changes.)
2013-01-20 18:22:35 +00:00
J. Tyne
d79877c733 Fix variations not being affected by [advancefrom] (in a different unit type). 2013-01-20 17:16:48 +00:00
Nils Kneuper
70b63dac4b updated French translation
fixed changelog to have 80 chars per line for the latest version
2013-01-20 09:01:26 +00:00
J. Tyne
7e3602822b Doxygen-fy a comment. 2013-01-20 04:39:56 +00:00
J. Tyne
a9734ce497 The wiki says that [unit_type]alignment= defaults to "neutral",
...so stop spitting out an error message when WML does not set it.
2013-01-20 04:38:27 +00:00
Matthias Schoeck
40c7046b5a Add new AI aspect leader_ignores_keep.
If set, AI leaders do not move to the closest keep at the beginning of
the turn.  Instead, they participate in the move_to_targets candidate
action (and all other CAs in which they already participated anyway,
of course).  The default value is 'no', which leaves the default
behavior unchanged.
2013-01-20 04:07:08 +00:00
J. Tyne
08925883f9 Changelog entry for 2013-01-20T02:43:38Z!jt_coding@verizon.net. 2013-01-20 03:06:14 +00:00
J. Tyne
d66a950a31 Keep track of the original unit type ID (variations can override it).
Use the original (base) ID when creating units.
2013-01-20 02:43:38 +00:00
J. Tyne
bdffe47578 When logging messages about unit_types, include an indication...
...if the type is a gendered subtype ([male] or [female]; not directly
related to gender=) and/or a [variation].

Gender appears in parentheses; variation name in square brackets.
2013-01-19 18:21:51 +00:00
J. Tyne
d971271d15 Have [unit_type] variations (including [male]/[female])...
...inherit their parent's ID, even if inherit=no.

If a variation is really supposed to have a blank ID, that can still
be accomplished by explicitly setting id="".
2013-01-19 17:01:48 +00:00
J. Tyne
0713c12a3f Add a "const" qualifier to unit_type::cfg_.
This was made possible by 2013-01-19T13:45:47Z!jt_coding@verizon.net, and reduces the number of
blank attributes inserted into the config. (Almost eliminates the
blank attributes in unit_type configs, but variations still get
"inherited=" inserted if it was not specified.)
2013-01-19 15:53:49 +00:00
J. Tyne
81159e7c42 Move processing of child configs from unit_type to unit_type_data::set_config().
It is a bit hacky to have unit_type modify the config passed as a
parameter to its constructor, especially when the modifications are
not done by the constructor.

As for performance, this change has little impact on the net time
taken by set_config(). While it does spend more time processing
configs, it takes less time building unit_types. The net result might
be a small increase in time, but any increase is comparable to the
variations in time seen amongst multiple test runs.
2013-01-19 13:45:47 +00:00
J. Tyne
6f2798d0dd New function: config::inherit_from().
This is a complement to config::merge_with(), as it does a merge
without overwriting.  This has a few uses in unit_types.cpp, and using
this function makes the code a bit easier to understand at a glance.
2013-01-18 16:44:22 +00:00
J. Tyne
fc4c27c8b3 Some tweaks to unit_type_data::set_config().
Most notably, this now checks to see if the insertion was successful
and logs an error if it failed (meaning two [unit_type]s had the same
id).
2013-01-18 14:18:57 +00:00
J. Tyne
7e4bdcd5ad Refactor the implementation of [base_unit].
The previous version could fail if a unit type had multiple base
units, if it was defined before those unit types, and if those unit
types themselves had base units. (The config merge would lose a base
unit's base unit.)
2013-01-18 05:45:07 +00:00
Mark de Wever
1b0707518b Fix compilation of the unit tests.
Broken due to 2013-01-16T13:29:56Z!jt_coding@verizon.net.
2013-01-17 18:49:30 +00:00
Lari Nieminen
68cd31dc14 Added rhyging5's flames animation frames, provided by artisticdude.
Doesn't include any terrain or macro definitions, only the images.
2013-01-17 09:36:03 +00:00
Ignacio R. Morelle
5f0ce8d010 Make wmllint recognize victory_string, defeat_string,
...gold_carryover_string, and notes_string (all from the [objectives]
tag) as attributes that need to be made translatable
2013-01-17 05:43:48 +00:00
Matthias Schoeck
caf1ba4343 Update changelog with MP command-line changes 2013-01-17 04:55:42 +00:00
Matthias Schoeck
eb49509f9a Add --ignore-map-settings multiplayer commandline option 2013-01-17 04:42:17 +00:00
Simon Forsyth
2290e3d6b2 Use new log domain for ai test scripts to determine faction. 2013-01-17 04:13:49 +00:00
J. Tyne
83d2f8d862 Improve the laziness of the lazy building of types. 2013-01-17 03:02:00 +00:00
Matthias Schoeck
183c92b61f Remove the old and now unused commandline MP game function:
play_multiplayer_mode()
2013-01-17 00:34:19 +00:00
Matthias Schoeck
2c5b1fb336 Change an ai/testing log output from 'FACTION' to 'TEAM'. 2013-01-17 00:10:23 +00:00
Matthias Schoeck
57652a546d Add faction name to log output for MP games 2013-01-17 00:03:35 +00:00
Fabian Müller
7397145f29 Made the movement cost tooltip title string translatable. 2013-01-16 23:43:39 +00:00
Matthias Schoeck
07afd27fbc Make side leader names consistent with lobby MP conventions...
...for AI controlled sides in commandline mode.  Also ensure that the
RCA AI is selected as default AI.
2013-01-16 23:25:05 +00:00
Fabian Müller
eecf2d2a28 Added color coding for the tod tooltip. 2013-01-16 21:35:15 +00:00
J. Tyne
c632e277d6 No need to set these fields twice in the constructor.
(I checked -- nothing changes them after the initialization list.)
2013-01-16 21:05:01 +00:00
Matthias Schoeck
1919dd5e7b The MP lobby code specifically sets share_view=yes...
...if it is not specified for a side in the scenario code.  Do the
same for commandline MP games.
2013-01-16 20:57:47 +00:00
Simon Forsyth
9c9e98e9c9 Add even more warnings when building with Xcode 2013-01-16 19:08:17 +00:00
J. Tyne
b37bff4925 Eliminate a string variable through inlining. 2013-01-16 18:15:48 +00:00
Simon Forsyth
2a5b2a3669 Add more warning flags when compiling with Xcode 2013-01-16 18:11:47 +00:00
J. Tyne
c751d89508 Fix comparisons between signed and unsigned types. 2013-01-16 18:04:56 +00:00
Matthias Schoeck
0a0e7925c2 Fix a function declaration 2013-01-16 17:58:56 +00:00
Matthias Schoeck
32e8e0dbfe Set up multiplayer games started from the commandline...
...equivalently to lobby games.

This means that parameters now use the correct default values,
scenarios using random maps work and side leaders always have unique
IDs.  Scenario and side parameters are defined as follows, in order of
increasing priority:

  Wesnoth defaults --> map settings --> commandline-specified values

All modifications are in a code path separate from lobby games (as it
was before), so lobby games are not affected.

This fixes bugs #19853, #19883, #19895 and #20009.
2013-01-16 17:13:58 +00:00
Fabian Müller
df24cf3360 Tooltip for the moves now displays the movement costs in the sidebar. 2013-01-16 16:20:52 +00:00
J. Tyne
177605fbaf Introduce a typedef to make some of the code more readable. 2013-01-16 14:29:31 +00:00
J. Tyne
2da6f3cd3b Change the unit constructor based on a unit_type to take a reference...
...instead of a pointer that was assumed to be (and in fact always
was) non-NULL.
2013-01-16 13:29:56 +00:00
J. Tyne
8c83185317 Change unit::advance_to() so that it takes a unit_type reference...
...instead of a pointer that was assumed (in many places) to be
non-NULL.
2013-01-16 12:53:45 +00:00
J. Tyne
b65d5603ee Change unit::type() to return a reference instead of a never-NULL pointer. 2013-01-16 12:07:23 +00:00
J. Tyne
d09401df2c Check for unit types found before creating units based on them. 2013-01-16 03:19:31 +00:00
J. Tyne
4bb579c875 Some optimizations made possible by 2013-01-16T00:41:43Z!jt_coding@verizon.net (unit::type() is never NULL). 2013-01-16 01:18:49 +00:00
J. Tyne
4de746be72 Have unit store a pointer to unit_type instead of a unit_type ID string.
In addition to speeding access to the unit_type (no need to search),
this makes it easier to see that a unit always has a valid unit_type
(an exception is thrown otherwise).
2013-01-16 00:41:43 +00:00
Fabian Müller
991a3a0878 Put a procedure from unit_helper in use to avoid duplicate code. 2013-01-15 22:24:16 +00:00
Fabian Müller
1fb1590df4 Color coded the hp/resistance tooltip of the sidebar unit display. 2013-01-15 15:48:20 +00:00
Fabian Müller
b6ef09062d Add precudure for calculating the font color of a resistance value. 2013-01-15 15:35:55 +00:00
J. Tyne
398bd4d432 Correct a comment (copy-and-paste error). 2013-01-14 23:26:22 +00:00
J. Tyne
40f0762454 Don't specify "const" when returning by value.
(We don't care if the caller modifies it.)
2013-01-14 23:25:35 +00:00