Codechange: Replace ScriptObject::[SG]etAllowDoCommand with ScriptObject::DisableDoCommandScope

This commit is contained in:
glx22
2025-06-03 00:47:48 +02:00
committed by Loïc Guilloux
parent 4beb23af30
commit 31fbb17c5b
5 changed files with 28 additions and 57 deletions
+5 -15
View File
@@ -84,6 +84,11 @@ protected:
static ScriptInstance *active; ///< The global current active instance.
};
class DisableDoCommandScope : private AutoRestoreBackup<bool> {
public:
DisableDoCommandScope();
};
/**
* Save this object.
* Must push 2 elements on the stack:
@@ -265,21 +270,6 @@ protected:
*/
static const CommandDataBuffer &GetLastCommandResData();
/**
* Store a allow_do_command per company.
* @param allow The new allow.
*/
static void SetAllowDoCommand(bool allow);
/**
* Get the internal value of allow_do_command. This can differ
* from CanSuspend() if the reason we are not allowed
* to execute a DoCommand is in squirrel and not the API.
* In that case use this function to restore the previous value.
* @return True iff DoCommands are allowed in the current scope.
*/
static bool GetAllowDoCommand();
/**
* Set the current company to execute commands for or request
* information about.