57600 Commits

Author SHA1 Message Date
Chris Beck
13155c4f41 separate fake units list from real units list
This is a first step before brnaching off to fake units manager
2014-06-16 15:19:24 -04:00
Nils Kneuper
87c391d960 updated German translation 2014-06-16 20:35:09 +02:00
gfgtdf
81161da78b preserve [story] on random scenario generation
this was the previous behaviour. That also HttT 17 expects.
2014-06-16 20:34:25 +02:00
Alexander van Gessel
b5b287ad6b Merge branch 'master' of github.com:wesnoth/wesnoth 2014-06-16 20:10:19 +02:00
Alexander van Gessel
b815ac9d7b Use resolution detection function at startup
It was previously used only for the resolution selection dialog.
2014-06-16 20:08:44 +02:00
gfgtdf
1d4c0f2df8 remove unneeded code in playcampaign.cpp
the carryover code now reads the "next_underlying_unit_id" and [end_level_data] directly form the last snapshot which is expicitly created before the playsingle_controller object is destroyed (in playcampaign.cpp), so no reason to write them here.

also the state_of_game.carryover_sides_start["next_scenario"] = resources::gamedata->next_scenario(); is not needed since show_carryover_message doesn't do this neigher (it's done done by convert to start save later).
2014-06-16 20:05:08 +02:00
Espreon
c8848813fd Improved theme descriptions 2014-06-16 13:19:54 -04:00
Chris Beck
750e759123 fixup gcc 4.4 warning (compare unsigned vs signed int)
Warnings reported here:
http://baldras.wesnoth.org:8080/job/Wesnoth/179/branch=master,compiler=4.4,label=Gentoo-64/consoleText
2014-06-16 12:41:03 -04:00
mattsc
156726a6a4 ai_helper.move_unit_out_of_way: fix direction rating
This is supposed to be a minor rating, secondary to the main rating.
2014-06-16 08:08:01 -07:00
mattsc
9e8ee00ad0 battle_calcs: provide default value for resistance modifiers
This is done for cases when the value cannot be read from the unit_info
table, which might happen in some UMC.  This fixes a rare bug affecting
the Fast Micro AI attack evaluation
2014-06-15 19:34:25 -07:00
gfgtdf
ac262a15d4 fix unused variable warning 2014-06-16 02:25:15 +02:00
gfgtdf
9fb2fe9334 fix build
i copied this wrongly.
2014-06-16 01:53:15 +02:00
gfgtdf
1c7c524150 Update syncmp_handler.cpp
lets hope that this fixes the build.
2014-06-16 01:34:25 +02:00
gfgtdf
8edaafec6f remove unneeded includes in replay.cpp 2014-06-16 01:16:14 +02:00
gfgtdf
11169c60eb removed unneeded replaystack.clear call
we already clear the undostack after an action if data was sended over teh netwrok (we call synced_context::can_undo to check) so there is no need for the call here.
2014-06-16 01:10:10 +02:00
gfgtdf
e92085aeaf remove transfered sides from [carryover_sides]
instead of just removing the units

if they are used in the current scenario
2014-06-16 01:06:59 +02:00
gfgtdf
4260aecf62 remove outcommented code 2014-06-16 00:48:11 +02:00
gfgtdf
c1c76881c7 small playcampaign refactor
we move state_of_game.expand_carryover(); out of playmp/singel scenario to remove code dublication

we move gamestate.get_starting_pos().child_range("story"); after expand_random_scenario because expand_random_scenario might invalidate the returnvalue of child_range("story").
2014-06-16 00:46:00 +02:00
gfgtdf
699fbaef67 remove useless code in playcampaign.cpp
we don't need gamestate.carryover_sides_start["next_scenario"] = resources::gamedata->next_scenario(); at that location, becasue that function only does the message, the actual carryover was moved to saved_game.cpp/carryover.cpp
2014-06-16 00:39:54 +02:00
gfgtdf
20267cec05 fix get_user_choice_multiple_sides
the comment in replay.cpp says we want "send data to others" so
calling "pull_remote_user_input" is not really correct. I added a
function synced_context::send_user_choice for this case.

this fixes a bug where players can get an oos error in
wesnoth.synconize_choice
I backported a simpler version to 1.12:
0e79ef919f5718cd8024bbbac31ed1e7b67e4fc7 because i don't know whether
this bug can happen in 1.12 too.
2014-06-15 23:46:43 +02:00
Lari Nieminen
17974a4bb1 Refresh fog/shroud when the Ghouls appear 2014-06-16 00:26:50 +03:00
mattsc
faeaf5e47c ai_helper.get_attacks: improve check for units in the way
Check whether the unit in the way has an unoccupied hex to move to.
Previously, it was only checked whether its reach was >1, which
sometimes can include only hexes occupied by units on its own side,
making the actual move impossible.
2014-06-15 14:22:18 -07:00
gfgtdf
c5301e5851 add compability code for old savefiles
midgame saves (those that have [snapshot]) shoudn't have a [carryover_sides_start]
2014-06-15 22:55:38 +02:00
Chris Beck
f25496ebc2 use gcc 4.8 on travis
This is temporary... for some reason gcc 4.6 is segfaulting while
clang and 4.8 compile successfully, so in the meantime use 4.8 on
travis.
2014-06-15 16:48:05 -04:00
Chris Beck
35180b82d1 Merge branch 'reference_count_units' 2014-06-15 15:04:29 -04:00
mattsc
ded53dd332 Stationed Guardian Micro AI: make guard_x/y optional keys
If not provided, they now default to stationed_x/y.
2014-06-15 11:59:36 -07:00
Chris Beck
e32de173ea remove unit.hpp include from team.hpp 2014-06-15 14:57:47 -04:00
Chris Beck
9e7dc5ba00 unit_map, lua, team recall lists use reference counted UnitPtr
Defines a UnitPtr (boost::intrusive_ptr<unit>, after irc
discussion), which the engine will use to pass units between
different modules, and which it is planned that the animation
engine will also hold, to avoid segfaulting.

Unfortunately this commit could not really be made smaller, it is
necessary to change all of these things over at once, or specify
very complicated deletion policies for the units at the
boundaries of the modules.

The main intention of the commit is to get these three modules
using a reference counting system to hold units, even as they
are passed between the modules. Eventually the fake units and
other kinds of units will all also be held in such pointers, and
the unit_map::unit_pod object will be replaced itself with a
single smart pointer.

Finally the animations objects will hold weak pointers to units,
to fix the segfault issues.

This commit required us to change over the whiteboard, most of
the action_wml, and the AI modules, since these make use of the
recall list from the team class.

We also add the unit_ptr.hpp header file, to allow to forward
declare the UnitPtr object essentially, and it's const variation.

If we forward declare the intrusive_ptr functions, we can forward
declare the UnitPtr type and avoid including unit in a bunch of
places that we don't need to. (Good as that is a very heavy
include.)

The declaration is now in unit_ptr.hpp

Since we can't forward declare inheritance, the easiest way to
resolve linker problems is to not derive unit from the
reference_counted_object class and just include the intrusive_ptr
boilerplate as usual instead.
2014-06-15 14:57:47 -04:00
Alexander van Gessel
5f6487c4e5 Merge pull request #204 from aquileia/ignore
Merge all remaining .gitignore files
2014-06-15 20:29:46 +02:00
gfgtdf
fba6cb5f2d Merge pull request #201 from gfgtdf/gamestate_refactor
change savefile format & wesnothd protocoll

The main intentions of this patch are:
1) To remove redundant information in savefiles
2) To fix mp/sp bugs: "modification [event]s wont be reaplied if one advances from a mp game (also if it was reloaded from sp that was reloaded in sp)"
3) To fix "start-of-scenario mp saves are broken"
4) Clear up playcampaign.cpp s code

This patch changes the wesnothd server protocoll causing incompability with oder version regarding networked mutiplayer. We now use the savefile fomat when sending new games to the server.

Also between some commits in this pr some mp related things will not work.
2014-06-15 18:13:06 +02:00
gfgtdf
976d990804 fix random map generation
this was previously broken because we passed a temporary pointer to
generate_map. While fixing this i moved it to saved_game.cpp

i also added a call to expand_random_scenario in mp_game_utils so that
in a mp campaign players advance to the next scenario which is randomly
generated. they have all the same scenario.
2014-06-15 17:31:15 +02:00
gfgtdf
8362414428 remove mp_game_settings::scenario_data
this is not used anore since we use saved_game::starting_pos now
2014-06-15 17:31:04 +02:00
gfgtdf
d9c6d18a63 fix [option]s/[events]s in [modification]s and [era]
this was broken by a commite earlier by me.

We now add them to teh scenario in saved_game.cpp and not in the mp
code. The reason is that we stil want them to work if a mp campaign game
was reloaded in sp.
2014-06-15 17:30:54 +02:00
gfgtdf
b5c0ec8a0a fix mp reloading
having with network/network_ai together with force_lock_settings_ cause
assertion errors because update_controller_options won't add any
possible options.

this patch restores the previous behaviour where force_lock_settings_
was ignored for reloaded games.
2014-06-15 17:30:43 +02:00
gfgtdf
b00a05fb00 expand save_id default value eralier
Set this default value immideately after reading the scenario is
importent because otherwise we might endup settings this value to the
multiplayer players name, which would break carryover. (doing this in at
config loading in game_config would be ok too i think.)
2014-06-15 17:30:33 +02:00
gfgtdf
ea6c8d475e ignore allow_new_game for reloaded games
this fixes a bug when reloaded games  started immideately for joining
players.
2014-06-15 17:30:23 +02:00
gfgtdf
92aa66680a fix commandline mp start 2014-06-15 17:30:12 +02:00
gfgtdf
7e3b5c199a add not_corrupt() function in saved_game class
and add comments about other functions.
2014-06-15 17:30:02 +02:00
gfgtdf
ac9628e3cf fix servergenerated replays
I also removed 'mp_game_title' because if i leave it, it casues an 'attributes not in order' error since level_ contains attributes. Idk what it does so i removed it. if we want it we should write in into level_
2014-06-15 17:29:52 +02:00
gfgtdf
f4db54b053 fix test/ compilation 2014-06-15 17:29:41 +02:00
gfgtdf
7172e43cf8 make wesnothd use savefile format for new games
the serverside part
2014-06-15 17:29:28 +02:00
gfgtdf
728b29dc61 make wesnothd use savefile format for new games
This patch changes the mp wesnothd protocol.

multiplayer connect now works as following:
multiplayer_create/configure creates saved_game object which is then
loaded by mp_connect and sended to the server in the usual savefile
format, this especially implies that [side] are no longer at toplevel
but instead nested into [scenario] or [snapshot].

mp options are saved into state (the saved_game object)
(state_.mp_settings()) previously we had a separate mp_settings object
for that now we only have one mp_setting object.

This commit still not fixes mp modification/era events/options. The
reason is, that i want to move the expansion of those to saved_game.cpp
for better compatibility to Sp (Especially make era events work in mp games
reloaded in sp), but if that won't work i'll just enable them how they
were before.

There  are still some things to do. Especially the server generated
replay-saves will be completely broken. (will fix in another commit)

we don't use the [replay_start] as starting pos in mp anymore so i removed
2 lines in playcampaign that assumed that.

I also removed soem code in mo_game_utils that seemed redundant, bugged or useless

since we now send the [carryover_sides_start] over the network too there
is no reason to apply [carryover_sides_start] before getting into
mp_connect engine (when advanging the the next scenario), even more,
since the new code expects only ONE of [carryover_sides_start] or
[carryover_sides] to be present, we cannot expand carryover_sides_start
in playcampaign before going to mp_connect because we might wan to modify
[carryover_sides_start] in mp_connect

still TODO:
* rename mp::configure::get_parameters
* reimplement mp modification/era s events/options
* remove fields from the mp_game_settings object
* remove disabled/outcommented code
2014-06-15 17:29:17 +02:00
gfgtdf
dd7dca975d fixup scenario advancing
the "gamestate().remove_snapshot();" is unneded and would undo the
"gamestate().set_snapshot();" in playcampaign
2014-06-15 17:00:54 +02:00
gfgtdf
ee7ab9bc69 remove set unneeded difficuly
we don't store difficulcy in carryover_sides_start anymore
2014-06-15 17:00:53 +02:00
gfgtdf
33504a7e90 simplyfy level_to_gamestate
most liley level_to_gamestate is currently broken since the latest
saved_game changes, but this commit doesn't change anything
2014-06-15 17:00:52 +02:00
gfgtdf
5ec441abb4 remove outdated line
we store difficulcy only in classification, not in carryover_sides_start
2014-06-15 17:00:51 +02:00
gfgtdf
9e40b26219 load replay from [scenario] if [replay_start] is not present
the intention is to change the serverside generated replays to contain
[scenario] & [carryover_sides_start] & [replay]. [replay_start] would
be wrong because carryover isn't expanded in these servergenerated
saves.

Servergenerated saves from reloaded (non start of scenario) games will
then contain  [replay_start] & [carryover_sides] & [replay]
2014-06-15 17:00:50 +02:00
gfgtdf
a8983333b5 remove unneeded code
we read the replay from [replay_start] not form [carryover_sides_start]
so no need to write them there.
2014-06-15 17:00:49 +02:00
gfgtdf
79797c3e4f minor playcampaign refactor 2014-06-15 17:00:48 +02:00
gfgtdf
0b754ce14b make use of playsingle_controller optional 2014-06-15 17:00:46 +02:00