feature request #9990: post-heal "side turn"-like event hook

new event "turn refresh" occurs after healing, calculating income, and
restoring movement (note: this intentionally excludes the first turn)
This commit is contained in:
Patrick Parker 2007-09-15 18:06:55 +00:00
parent b1081bfb2b
commit a4d88c6478
3 changed files with 4 additions and 1 deletions

View file

@ -78,6 +78,8 @@
* add an "Animate Map" option in advanced preferences, to switch flag and
terrain animation off
* WML engine:
* new event "turn refresh" occurs after healing, calculating income, and
restoring movement (note: this intentionally excludes the first turn)
* now tag [filter_adjacent] is supported in the Standard Unit Filter (SUF)
* now tag [filter_adjacent_location] is supported in the Standard Location
Filter (SLF)

View file

@ -363,6 +363,7 @@ void play_controller::init_side(const unsigned int team_index, bool /*is_replay*
calculate_healing((*gui_),map_,units_,player_number_,teams_, !recorder.is_skipping());
reset_resting(units_, player_number_);
game_events::fire("turn refresh");
}
const time_of_day &tod = status_.get_time_of_day();

View file

@ -1079,7 +1079,7 @@ bool do_replay(game_display& disp, const gamemap& map, const game_data& gameinfo
const std::string event = (*child)["raise"];
//exclude these events here, because in a replay proper time of execution can't be
//established and therefore we fire those events inside play_controller::init_side
if ((event != "side turn") && (event != "turn 1") && (event != "new_turn")){
if ((event != "side turn") && (event != "turn 1") && (event != "new turn") && (event != "turn refresh")){
const config* const source = child->child("source");
if(source != NULL) {
game_events::fire(event, gamemap::location(*source, game_events::get_state_of_game()));