From 850385465543a9bd589084ec2ac6b0693c481fea Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 28 Nov 2021 22:43:38 +0100 Subject: Codechange: Pass unpacked command arguments to command callbacks (except Script). --- src/script/api/script_object.cpp | 2 +- src/script/api/script_object.hpp | 2 +- src/script/script_cmd.h | 4 ++-- src/script/script_instance.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/script') diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp index de4fab481..ff109dbdf 100644 --- a/src/script/api/script_object.cpp +++ b/src/script/api/script_object.cpp @@ -296,7 +296,7 @@ ScriptObject::ActiveInstance::~ActiveInstance() return GetStorage()->callback_value[index]; } -/* static */ CommandCallback *ScriptObject::GetDoCommandCallback() +/* static */ CommandCallbackData *ScriptObject::GetDoCommandCallback() { return ScriptObject::GetActiveInstance()->GetDoCommandCallback(); } diff --git a/src/script/api/script_object.hpp b/src/script/api/script_object.hpp index 8d9be14c4..11d9542c8 100644 --- a/src/script/api/script_object.hpp +++ b/src/script/api/script_object.hpp @@ -326,7 +326,7 @@ private: /* Helper functions for DoCommand. */ static std::tuple DoCommandPrep(); static bool DoCommandProcessResult(const CommandCost &res, Script_SuspendCallbackProc *callback, bool estimate_only); - static CommandCallback *GetDoCommandCallback(); + static CommandCallbackData *GetDoCommandCallback(); }; namespace ScriptObjectInternal { diff --git a/src/script/script_cmd.h b/src/script/script_cmd.h index bf6aa50c7..c1b3a9b23 100644 --- a/src/script/script_cmd.h +++ b/src/script/script_cmd.h @@ -12,7 +12,7 @@ #include "../command_type.h" -CommandCallback CcAI; -CommandCallback CcGame; +CommandCallbackData CcAI; +CommandCallbackData CcGame; #endif /* SCRIPT_CMD_H */ diff --git a/src/script/script_instance.hpp b/src/script/script_instance.hpp index c30fd1499..290568fdd 100644 --- a/src/script/script_instance.hpp +++ b/src/script/script_instance.hpp @@ -235,7 +235,7 @@ protected: /** * Get the callback handling DoCommands in case of networking. */ - virtual CommandCallback *GetDoCommandCallback() = 0; + virtual CommandCallbackData *GetDoCommandCallback() = 0; /** * Load the dummy script. -- cgit v1.2.3-54-g00ecf