diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index 32f53c5316bc..9f62a19c502a 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -308,7 +308,7 @@ function wml_actions.test_condition(cfg) if tag == "variable" then explanation = string.format("%s\n\tNote: The variable %s currently has the value %q.", explanation, this_cfg.name, tostring(wesnoth.get_variable(this_cfg.name))) end - wesnoth.wml_actions.wml_message{message = explanation, logger = logger} + wesnoth.log(logger, explanation, true) return true end end @@ -1018,7 +1018,7 @@ end function wml_actions.wml_message(cfg) local logger = cfg.logger or '' - wesnoth.log(cfg.logger, cfg.message. cfg.to_chat) + wesnoth.log(cfg.logger, cfg.message, cfg.to_chat) end local function parse_fog_cfg(cfg) diff --git a/src/whiteboard/manager.cpp b/src/whiteboard/manager.cpp index 7d312aaf7181..962560b9e585 100644 --- a/src/whiteboard/manager.cpp +++ b/src/whiteboard/manager.cpp @@ -480,7 +480,7 @@ namespace public: move_owners_finder(): move_owners_() { } - void operator()(action_ptr action) { + void operator()(action* action) { action->accept(*this); } diff --git a/src/whiteboard/utility.cpp b/src/whiteboard/utility.cpp index 30517e88d67a..5096ef0dd746 100644 --- a/src/whiteboard/utility.cpp +++ b/src/whiteboard/utility.cpp @@ -165,7 +165,7 @@ bool team_has_visible_plan(team &t) return !t.get_side_actions()->hidden(); } -void for_each_action(std::function function, team_filter team_filter) +void for_each_action(std::function function, team_filter team_filter) { bool end = false; for(size_t turn=0; !end; ++turn) { @@ -173,7 +173,9 @@ void for_each_action(std::function function, team_filter team_ for(team &side : *resources::teams) { side_actions &actions = *side.get_side_actions(); if(turn < actions.num_turns() && team_filter(side)) { - std::for_each(actions.turn_begin(turn), actions.turn_end(turn), function); + for(auto iter = actions.turn_begin(turn); iter != actions.turn_end(turn); ++iter) { + function(iter->get()); + } end = false; } } diff --git a/src/whiteboard/utility.hpp b/src/whiteboard/utility.hpp index 5c14eb39f180..ffa4ef24d415 100644 --- a/src/whiteboard/utility.hpp +++ b/src/whiteboard/utility.hpp @@ -126,7 +126,7 @@ bool team_has_visible_plan(team&); * @param function the function to execute. * @param team_filter select whether a team is visited (default to @ref team_has_visible_plan). */ -void for_each_action(std::function function, +void for_each_action(std::function function, team_filter team_filter = team_has_visible_plan); /**