summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2021-11-28 22:43:38 +0100
committerMichael Lutz <michi@icosahedron.de>2021-12-16 22:28:32 +0100
commit850385465543a9bd589084ec2ac6b0693c481fea (patch)
treefa0d375d36e946caee2c4ebc6a8ecd4e35f33d5b /src/script
parentd85348b1d1b9aa7099255eda7c1058f9749d1003 (diff)
downloadopenttd-850385465543a9bd589084ec2ac6b0693c481fea.tar.xz
Codechange: Pass unpacked command arguments to command callbacks (except Script).
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/script_object.cpp2
-rw-r--r--src/script/api/script_object.hpp2
-rw-r--r--src/script/script_cmd.h4
-rw-r--r--src/script/script_instance.hpp2
4 files changed, 5 insertions, 5 deletions
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<bool, bool, bool> 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.