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.
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.
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.
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.
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.
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).
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.
Use of std::sort sometimes led to clients sorting placings with equal scores differently, leading to OOS when clients placed sides in different castles.
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.