62141 Commits

Author SHA1 Message Date
gfgtdf
ec8bf1e1f7 move reset_gamestate function (reset_replay) to play_controller 2015-09-09 17:46:10 +02:00
gfgtdf
941f00e491 move player_number_ to game_state 2015-09-09 17:46:08 +02:00
gfgtdf
8e875b8458 move init_side_done_ to game_state class 2015-09-09 17:46:06 +02: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
99c75bf9ae use scoped_ptr for gamestate_ 2015-09-09 17:20:49 +02:00
gfgtdf
fab8b9dc30 dont keep [scenario]/[snapshot] config during play
the intention is to save some ram usage.
2015-09-09 17:20:47 +02:00
gfgtdf
942220da80 remove unused parameter 2015-09-09 17:20:45 +02:00
gfgtdf
9d9422a423 refactor replay_controller
Instead of implementing its own game loop,
replay_controller now uses play_controller game loop.

This prepares a patch to use replay functionality in mp games.
2015-09-09 17:19:20 +02:00
gfgtdf
c8f9b2b530 move function play_turn from playsingle_controller to play_controller
the intention is that we can use those function in replay_controller.cpp
2015-09-09 17:17:46 +02:00
gfgtdf
11daa5113a refactor maybe_do_init_side
we now check for nit_side_done everytime the controller type changes
to that we don't have to check for that when recieveing a conroller
change in playturn.cpp

This also contains a unrelated fix (to the function that checks
which side can be seen) that got accidently merged into this commit.
2015-09-09 17:12:28 +02:00
gfgtdf
c910dc6533 remove a unneeded if 2015-09-09 17:10:51 +02:00
gfgtdf
d74b85fffc set "side_number" in play_controller::do_init_side
instead of in play_controller::init_side_begin, the prviosul
implementation could change the value of this wml variable when
reloading.
2015-09-09 17:10:50 +02:00
gfgtdf
edd32073fa move play_side to play_controller
the intention is that replay_controller can also use this function later
2015-09-09 17:10:48 +02:00
gfgtdf
ded13b1cc8 refactor playsingle_controller::before_human_turn
Also removed a raise_turn_started event at the beginning of human turns
which didn't fire at the beginning of networked turns.

I don't know what the raise_turn_started did if this actually breaks
anything feel free to read it but please add a comment on why it fires
on human turns but not on networked turns.
2015-09-09 17:05:51 +02:00
gfgtdf
1172369dca refactor playsingle_controller::play_side() 2015-09-09 16:50:35 +02:00
gfgtdf
d254577762 simplify fallback_ai_to_human_exception handling
the effect is sligltly different (the side is now permanently changed to
human) but since it quiet easy to change a side back to ai using debug
commands this shouldnt be that bad.
2015-09-09 16:50:32 +02:00
gfgtdf
58874bdd0b remove level_ from game_state class
The intention is to remove the level config (mainly to decrease memory usage)
2015-09-09 16:31:38 +02:00
gfgtdf
9ac0434c1d use play_controller::player_number_ to write [snapshot]playing_team= 2015-09-09 16:31:36 +02:00
gfgtdf
41e363a3fd fix a segfault caused by wesnoth.theme_items
http://gna.org/bugs/?23856

previously reports::register_generator sometimes created two shared_ptr
from one generator * which caused that generator to be freed twice (or
worse).
2015-09-09 16:31:35 +02:00
gfgtdf
12b901933a make the unit id manager a member of game_board
previously it was a singleton

the next unit id counter is part of the gamestate so it should be part of the game_state object.
2015-09-09 16:31:34 +02:00
gfgtdf
4afe65b4da move it_is_a_new_turn_ variable to tod_manager
it_is_a_new_turn_ is part of the gamestate so it should be part of the game_state object.
2015-09-09 16:31:33 +02:00
gfgtdf
4103ae29f5 remove unused play_controller::start_turn_ variable 2015-09-09 16:31:32 +02:00
gfgtdf
12e839b9b7 remove level_ member of game_lua_kernel
the intention is to be able to remove the level cfg.
2015-09-09 16:31:30 +02:00
gfgtdf
368a4ab284 fix indention 2015-09-09 16:31:29 +02:00
gfgtdf
adc5eca399 add optional string key parameter to config::append_children 2015-09-09 16:31:28 +02:00
gfgtdf
402a97e1fc fix some code formatting 2015-09-09 16:31:27 +02:00
gfgtdf
fe3f317cbc use config object to store menu items in carryover
the carryover code does not modify the menu items to there is no need to
deserialize them. Using config objects here simplyfies the code becasue
carryover is now independent from the wmi_container's class.
2015-09-09 16:31:26 +02:00
Elias Pschernig
00516dddbe [units.wesnoth.org] always clean up error log 2015-09-09 10:30:35 -04:00
mattsc
74b54da691 Fast Micro AI: fix a typo in a parameter name 2015-09-09 06:46:58 -07:00
mattsc
e9f77d1dbf Fast Micro AI: add optional parameters for attacks by AI leader
The willingness of the AI leader to come out for attacks can be
adjusted with these.
2015-09-09 06:31:46 -07:00
Andreas Löf
c5bec31dae Change the ordering of the CMakeLists so options comes first.
This changes the ordering of the compile time options so the options
comes before any before any flags or checks that may depend on them.
2015-09-09 21:42:29 +12:00
ln-zookeeper
bb4238ee30 Updated changelogs and RELEASE_NOTES 2015-09-09 11:31:01 +03:00
Lari Nieminen
cc9cf1a8a5 Avoid side placement OOS by using std::stable_sort
Use of std::sort sometimes led to clients sorting placings with equal scores differently, leading to OOS when clients placed sides in different castles.
2015-09-09 11:13:49 +03:00
Elias Pschernig
2cdcae6294 [wmlunits] fix typo 2015-09-08 21:19:42 -04:00
Elias Pschernig
225234b121 [wmlunits: log used memory for pre-pass] 2015-09-08 20:56:14 -04:00
Elias Pschernig
1961c43f16 [wmlunits] clear <config>/data/add-ons
Sometimes if the last run aborted in the wrong moment, add-ons may keep
left overs in there.
2015-09-08 20:15:37 -04:00
ln-zookeeper
30fa10eb29 Updated changelog 2015-09-08 12:27:12 +03:00
ln-zookeeper
632b7f3a63 Defined slow/poison/petrify status sounds (same as hardcoded defaults) 2015-09-08 12:25:22 +03:00
ln-zookeeper
e4ed29c0ce Removed all uses of the now unnecessary SOUND:SLOW and SOUND:POISON 2015-09-08 12:11:12 +03:00
soliton-
85a5c1c9c7 Merge pull request #478 from ln-zookeeper/status_sounds
Fix problems with animation-based status sounds
2015-09-08 10:01:01 +02:00
Ignacio R. Morelle
e131262080 Rephrase a bit of unwieldy Lua that causes issues with my text editor 2015-09-07 20:21:41 -03:00
Ignacio R. Morelle
39033be9d3 Doxygen and other comment formatting 2015-09-07 20:21:40 -03:00
Elvish_Hunter
2e574252cb GUI.pyw: added more tooltips 2015-09-07 20:55:09 +02:00
Elvish_Hunter
814d9d1478 GUI.pyw: allow changing tooltip text at runtime 2015-09-07 20:55:09 +02:00
Elvish_Hunter
3cbbede271 GUI.pyw: use specific tooltip font 2015-09-07 20:55:09 +02:00
Elvish_Hunter
78e03f33f3 wmllint-1.4: removed tabs 2015-09-07 20:55:08 +02:00
mattsc
67f868306e Fast Micro AI: clean up unused debug output 2015-09-07 09:17:45 -07:00
Lari Nieminen
5c2927f52d Moved extra_hit_sounds to a smaller scope 2015-09-07 18:57:51 +03:00
mattsc
5533d5728a Fast Micro AI: separate out attacks by AI leader
In the previous version, the leader would sometimes leave the keep for
truly suicidal attacks. This commit adds an extra layer of analysis to
evaluate whether an attack position is safe enough.

This evaluation is too expensive to be done for all units for the
purpose of this AI, or even to be done for the leader more than once,
so this is separated out into its own candidate action that is only
evaluated once everything else is done.
2015-09-07 08:49:39 -07:00
Celtic Minstrel
cf18825a82 Merge branch 'CelticMinstrel/movetype' 2015-09-06 22:17:19 -04:00