Codechange: Pass unpacked command arguments to command callbacks (except Script).

This commit is contained in:
Michael Lutz
2021-11-28 22:43:38 +01:00
parent d85348b1d1
commit 8503854655
31 changed files with 96 additions and 75 deletions

View File

@@ -296,7 +296,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
return GetStorage()->callback_value[index];
}
/* static */ CommandCallback *ScriptObject::GetDoCommandCallback()
/* static */ CommandCallbackData *ScriptObject::GetDoCommandCallback()
{
return ScriptObject::GetActiveInstance()->GetDoCommandCallback();
}

View File

@@ -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 {

View File

@@ -12,7 +12,7 @@
#include "../command_type.h"
CommandCallback CcAI;
CommandCallback CcGame;
CommandCallbackData CcAI;
CommandCallbackData CcGame;
#endif /* SCRIPT_CMD_H */

View File

@@ -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.