Commit graph

25 commits

Author SHA1 Message Date
Martin Hrubý (hrubymar10)
bc4d22dc72 Migrate links to https if available - Fwd c18537edc0 2018-07-16 19:07:08 +11:00
gfgtdf
a32f6aaf64 make sure units are always stored in unit_ptr step2
previously the unit ctor could invoke arbitrary umc lua code, for
example via advance_to -> add_modification ->
resources::lua_kernel->apply_effect and during that call the unit was
not owned by a unit_ptr, so the code could not use unit_ptr objects at
several places because the unit might not be owned by a unit_ptr object.
2018-03-11 01:36:16 -05:00
Charles Dang
a3a9697d14 Cleaned up unnecessary inclusion of formula/string_utils.hpp
These were either not needed, or serialization/string_utils.hpp was desired instead.
2018-03-03 20:22:17 +11:00
Gregory A Lundberg
b5f76eff79
Bump copyright to 2018 2018-01-19 00:02:20 -06:00
gfgtdf
b572928e26 fix [side]type=""
this is now treated the same as having to type= attribute specified at all. fixes #1691
2017-05-14 12:47:33 +02:00
Charles Dang
647f3e12be Added small wrapper function for converting a bool to string 2017-04-28 12:41:38 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
gfgtdf
15afec7202 fixup 'improve error message in case of an invalid unittype in [side]' 2016-10-21 23:11:08 +02:00
gfgtdf
2f6bb71b82 improve error message in case of an invalid unittype in [side]
Since the erromessage is now shown in ERR_NG_TC the user knowns tha this error happend during team creation.
2016-10-21 22:40:11 +02:00
Charles Dang
6235e18bbd Replace resources::teams with resources::gameboard->teams() 2016-08-11 07:27:48 +11:00
gfgtdf
7ab539fb3d give a warning on wrong side= attributes.
previously the game ignores the side= attribute when the game was
started the normal way, and refused to load start-of-scenario of
scenario that ha a side with a wrong side= attribute.

Now in both cases it loads the scenario sucesfully but gives a warning.
2016-08-08 17:35:52 +02:00
Celtic Minstrel
ca382018b7 BOOST_FOREACH -> range for 2016-04-02 09:38:29 -04:00
Celtic Minstrel
3ac7f8d970 NULL -> nullptr
A few cases of NULL were missed, since changing them led to errors
(Mainly instances where it was passed to a boost::function)
2016-03-31 00:42:38 -04:00
Charles Dang
876710af8c Use std::to_string() or equivalent wherever possible
This commit removes the utility srt_cast() function and replaces its calls,
along with calls to lexical_cast<std::string>() (and its boost variant),
with std::to_string().

In a few cases where the input type isn't compatible with to_string,
lexical_cast<std::string> is still used.

In other cases where lexical_cast was operating on MAKE_ENUM enums, the
call has been replaced with ENUM::enum_to_string, which is faster.
2016-03-31 11:18:51 +11:00
Celtic Minstrel
bc711f5f43 Consolidate related files into subdirectories 2016-03-20 16:20:09 -04:00
Celtic Minstrel
fe0df45947 Consolidate formula and hotkey files in corresponding dirs 2016-03-20 16:15:50 -04:00
gfgtdf
c941f60c49 add new attribute side_name= in [side]
We cannot call it name becasue thats already used by the unti that is
generated from the side tag.

if given (nonempty), side_name= will be used instead of current_player
in some dialogs (new turn dialog, statistics).

In [scenario] side_name= defaults to name= while in [multiplayer]
side_name= defaults to empty (so that current_player is used in those
dialogs by default).

This specially fixes http://gna.org/bugs/?24226 while still giving wml
authors in mp and in sp the option to use the real players name in those
dialogs.
2016-03-08 17:44:30 +01:00
gfgtdf
163bdc9ecd fix sides with no type= attribute
If you dont want that the engine uses the [side] wml table to create a
leader for that side, it is now enough to just omit the type attribute.
Previously it was necessary to add a no_leader=yes attribute.

The no_leader attribute is still used by the mp connect engine (which is
also used in sp) to prevent the mp connect engine from adding a random
leader from the current era. no_leader now defaults to yes for sides in
[scenario] and to no for sides in [multiplayer] so that the connect
engine now by default doesn't add a random mp leader to sides in sp
games.
2016-01-06 02:47:42 +01:00
gfgtdf
acabc9201d Remove unused code
This code would cause OOS if it was used.
2016-01-06 02:47:40 +01:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Elvish_Hunter
9b7b1751fd Removed trailing tabs and whitespaces from C++ source
I used this command line: find <source directory> -name \*.\[ch\]pp -print0 | xargs -0 sed -i 's/[[:blank:]]*$//'
2015-12-21 20:39:46 +01:00
gfgtdf
20fafdee28 simplify game_state construction
instead of calling constructor and init you now only have to call the
constructor.

In order to make this work this commit removes the uses of
resources::gameboard/units during team construction. while doing that i
moved the unit_creator class to a new file.

This commit also removes the ticks parameter from game_startes
constructor and replaces it with a ticks() function in play_controller,
other classes were also changed to use the play_controller::ticks()
function.
2015-09-09 17:46:04 +02:00
gfgtdf
92bf33174b remove unused member variable 2015-02-11 22:40:31 +01:00
Ignacio R. Morelle
57ae45387a New Year copyright update 2015-01-01 19:07:35 -03:00
gfgtdf
6e02488b61 move teambuilder functions to new file teambuilder.cpp
They are not related to game_data so there is no reason why they should
be there.
2014-12-31 15:02:58 +01:00