Skip to content

Commit

Permalink
Revert "remove unused queued_event parameter from WML_HANDLER_FUNCTION"
Browse files Browse the repository at this point in the history
This reverts commit 310ba26.
  • Loading branch information
CelticMinstrel committed Apr 4, 2016
1 parent 0a7190c commit 38010fd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 31 deletions.
58 changes: 29 additions & 29 deletions src/game_events/action_wml.cpp
Expand Up @@ -310,21 +310,21 @@ wml_action::wml_action(const std::string & tag, handler function)
* }
* \endcode
*/
#define WML_HANDLER_FUNCTION(pname, pcfg) \
static void wml_func_##pname(const vconfig &pcfg); \
#define WML_HANDLER_FUNCTION(pname, pei, pcfg) \
static void wml_func_##pname(const queued_event &pei, const vconfig &pcfg); \
static wml_action wml_action_##pname(#pname, &wml_func_##pname); \
static void wml_func_##pname(const vconfig& pcfg)
static void wml_func_##pname(const queued_event& pei, const vconfig& pcfg)


/// Experimental data persistence
/// @todo Finish experimenting.
WML_HANDLER_FUNCTION(clear_global_variable,pcfg)
WML_HANDLER_FUNCTION(clear_global_variable,,pcfg)
{
if (!resources::controller->is_replay())
verify_and_clear_global_variable(pcfg);
}

WML_HANDLER_FUNCTION(deprecated_message, cfg)
WML_HANDLER_FUNCTION(deprecated_message,, cfg)
{
handle_deprecated_message( cfg.get_parsed_config() );
}
Expand All @@ -337,7 +337,7 @@ static void on_replay_error(const std::string& message, bool /*b*/)

// This tag exposes part of the code path used to handle [command]'s in replays
// This allows to perform scripting in WML that will use the same code path as player actions, for example.
WML_HANDLER_FUNCTION(do_command, cfg)
WML_HANDLER_FUNCTION(do_command,, cfg)
{
// Doing this in a whiteboard applied context will cause bugs
// Note that even though game_events::pump() will always apply the real unit map
Expand Down Expand Up @@ -380,17 +380,17 @@ WML_HANDLER_FUNCTION(do_command, cfg)

/// Experimental data persistence
/// @todo Finish experimenting.
WML_HANDLER_FUNCTION(get_global_variable, pcfg)
WML_HANDLER_FUNCTION(get_global_variable,,pcfg)
{
verify_and_get_global_variable(pcfg);
}

WML_HANDLER_FUNCTION(lift_fog, cfg)
WML_HANDLER_FUNCTION(lift_fog,, cfg)
{
toggle_fog(true, cfg, !cfg["multiturn"].to_bool(false));
}

WML_HANDLER_FUNCTION(modify_turns, cfg)
WML_HANDLER_FUNCTION(modify_turns,, cfg)
{
config::attribute_value value = cfg["value"];
std::string add = cfg["add"];
Expand All @@ -417,7 +417,7 @@ WML_HANDLER_FUNCTION(modify_turns, cfg)

/// Moving a 'unit' - i.e. a dummy unit
/// that is just moving for the visual effect
WML_HANDLER_FUNCTION(move_unit_fake, cfg)
WML_HANDLER_FUNCTION(move_unit_fake,, cfg)
{
fake_unit_ptr dummy_unit(create_fake_unit(cfg));
if(!dummy_unit.get())
Expand All @@ -438,7 +438,7 @@ WML_HANDLER_FUNCTION(move_unit_fake, cfg)
}
}

WML_HANDLER_FUNCTION(move_units_fake, cfg)
WML_HANDLER_FUNCTION(move_units_fake,, cfg)
{
LOG_NG << "Processing [move_units_fake]\n";

Expand Down Expand Up @@ -491,7 +491,7 @@ WML_HANDLER_FUNCTION(move_units_fake, cfg)
}

/// If we should recall units that match a certain description.
WML_HANDLER_FUNCTION(recall, cfg)
WML_HANDLER_FUNCTION(recall,, cfg)
{
LOG_NG << "recalling unit...\n";
config temp_config(cfg.get_config());
Expand Down Expand Up @@ -573,7 +573,7 @@ WML_HANDLER_FUNCTION(recall, cfg)
LOG_WML << "A [recall] tag with the following content failed:\n" << cfg.get_config().debug();
}

WML_HANDLER_FUNCTION(remove_sound_source, cfg)
WML_HANDLER_FUNCTION(remove_sound_source,, cfg)
{
resources::soundsources->remove(cfg["id"]);
}
Expand Down Expand Up @@ -618,7 +618,7 @@ namespace {
}
/// Experimental map replace
/// @todo Finish experimenting.
WML_HANDLER_FUNCTION(replace_map, cfg)
WML_HANDLER_FUNCTION(replace_map,, cfg)
{
/*
* When a hex changes from a village terrain to a non-village terrain, and
Expand Down Expand Up @@ -676,20 +676,20 @@ WML_HANDLER_FUNCTION(replace_map, cfg)
ai::manager::raise_map_changed();
}

WML_HANDLER_FUNCTION(reset_fog, cfg)
WML_HANDLER_FUNCTION(reset_fog,, cfg)
{
toggle_fog(false, cfg, cfg["reset_view"].to_bool(false));
}

/// Experimental data persistence
/// @todo Finish experimenting.
WML_HANDLER_FUNCTION(set_global_variable, pcfg)
WML_HANDLER_FUNCTION(set_global_variable,,pcfg)
{
if (!resources::controller->is_replay())
verify_and_set_global_variable(pcfg);
}

WML_HANDLER_FUNCTION(set_variable, cfg)
WML_HANDLER_FUNCTION(set_variable,, cfg)
{
game_data *gameinfo = resources::gamedata;
const std::string name = cfg["name"];
Expand Down Expand Up @@ -927,7 +927,7 @@ WML_HANDLER_FUNCTION(set_variable, cfg)
}
}

WML_HANDLER_FUNCTION(set_variables, cfg)
WML_HANDLER_FUNCTION(set_variables,, cfg)
{
const t_string& name = cfg["name"];
variable_access_create dest = resources::gamedata->get_variable_access_write(name);
Expand Down Expand Up @@ -1029,7 +1029,7 @@ WML_HANDLER_FUNCTION(set_variables, cfg)
}
}

WML_HANDLER_FUNCTION(sound_source, cfg)
WML_HANDLER_FUNCTION(sound_source,, cfg)
{
config parsed = cfg.get_parsed_config();
try {
Expand All @@ -1045,7 +1045,7 @@ WML_HANDLER_FUNCTION(sound_source, cfg)
/// Store the relative direction from one hex to another in a WML variable.
/// This is mainly useful as a diagnostic tool, but could be useful
/// for some kind of scenario.
WML_HANDLER_FUNCTION(store_relative_direction, cfg)
WML_HANDLER_FUNCTION(store_relative_direction,, cfg)
{
if (!cfg.child("source")) {
WRN_NG << "No source in [store_relative_direction]" << std::endl;
Expand Down Expand Up @@ -1081,7 +1081,7 @@ WML_HANDLER_FUNCTION(store_relative_direction, cfg)
/// In increments of 60 degrees, clockwise.
/// This is mainly useful as a diagnostic tool, but could be useful
/// for some kind of scenario.
WML_HANDLER_FUNCTION(store_rotate_map_location, cfg)
WML_HANDLER_FUNCTION(store_rotate_map_location,, cfg)
{
if (!cfg.child("source")) {
WRN_NG << "No source in [store_rotate_map_location]" << std::endl;
Expand Down Expand Up @@ -1118,7 +1118,7 @@ WML_HANDLER_FUNCTION(store_rotate_map_location, cfg)
/// Store time of day config in a WML variable. This is useful for those who
/// are too lazy to calculate the corresponding time of day for a given turn,
/// or if the turn / time-of-day sequence mutates in a scenario.
WML_HANDLER_FUNCTION(store_time_of_day, cfg)
WML_HANDLER_FUNCTION(store_time_of_day,, cfg)
{
const map_location loc = cfg_to_loc(cfg);
int turn = cfg["turn"];
Expand All @@ -1141,7 +1141,7 @@ WML_HANDLER_FUNCTION(store_time_of_day, cfg)
}

/// Creating a mask of the terrain
WML_HANDLER_FUNCTION(terrain_mask, cfg)
WML_HANDLER_FUNCTION(terrain_mask,, cfg)
{
map_location loc = cfg_to_loc(cfg, 1, 1);

Expand Down Expand Up @@ -1172,7 +1172,7 @@ WML_HANDLER_FUNCTION(terrain_mask, cfg)
resources::screen->needs_rebuild(true);
}

WML_HANDLER_FUNCTION(tunnel, cfg)
WML_HANDLER_FUNCTION(tunnel,, cfg)
{
const bool remove = cfg["remove"].to_bool(false);
if (remove) {
Expand All @@ -1197,7 +1197,7 @@ WML_HANDLER_FUNCTION(tunnel, cfg)
}

/// If we should spawn a new unit on the map somewhere
WML_HANDLER_FUNCTION(unit, cfg)
WML_HANDLER_FUNCTION(unit,, cfg)
{
config parsed_cfg = cfg.get_parsed_config();

Expand Down Expand Up @@ -1246,7 +1246,7 @@ WML_HANDLER_FUNCTION(unit, cfg)

}

WML_HANDLER_FUNCTION(volume, cfg)
WML_HANDLER_FUNCTION(volume,, cfg)
{

int vol;
Expand Down Expand Up @@ -1274,12 +1274,12 @@ WML_HANDLER_FUNCTION(volume, cfg)

}

WML_HANDLER_FUNCTION(wml_message, cfg)
WML_HANDLER_FUNCTION(wml_message,, cfg)
{
handle_wml_log_message( cfg.get_parsed_config() );
}

WML_HANDLER_FUNCTION(on_undo, cfg)
WML_HANDLER_FUNCTION(on_undo,, cfg)
{
if(cfg["delayed_variable_substitution"].to_bool(false)) {
synced_context::add_undo_commands(cfg.get_config());
Expand All @@ -1288,7 +1288,7 @@ WML_HANDLER_FUNCTION(on_undo, cfg)
}
}

WML_HANDLER_FUNCTION(on_redo, cfg)
WML_HANDLER_FUNCTION(on_redo,, cfg)
{
if(cfg["delayed_variable_substitution"].to_bool(false)) {
synced_context::add_redo_commands(cfg.get_config());
Expand Down
2 changes: 1 addition & 1 deletion src/game_events/action_wml.hpp
Expand Up @@ -48,7 +48,7 @@ namespace game_events

class wml_action {
public:
typedef void (*handler)(const vconfig &);
typedef void (*handler)(const queued_event &, const vconfig &);
typedef std::map<std::string, handler> map;

/// Using this constructor for a static object outside action_wml.cpp
Expand Down
2 changes: 1 addition & 1 deletion src/scripting/game_lua_kernel.cpp
Expand Up @@ -4865,7 +4865,7 @@ int game_lua_kernel::cfun_wml_action(lua_State *L)
(lua_touserdata(L, lua_upvalueindex(1)));

vconfig vcfg = luaW_checkvconfig(L, 1);
h(vcfg);
h(get_event_info(), vcfg);
return 0;
}

Expand Down

0 comments on commit 38010fd

Please sign in to comment.