summaryrefslogtreecommitdiff
path: root/src/script/api/script_object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/api/script_object.cpp')
-rw-r--r--src/script/api/script_object.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/script/api/script_object.cpp b/src/script/api/script_object.cpp
index 7a22e3ab7..67ab7e40d 100644
--- a/src/script/api/script_object.cpp
+++ b/src/script/api/script_object.cpp
@@ -36,7 +36,7 @@ static ScriptStorage *GetStorage()
}
-/* static */ ScriptInstance *ScriptObject::ActiveInstance::active = NULL;
+/* static */ ScriptInstance *ScriptObject::ActiveInstance::active = nullptr;
ScriptObject::ActiveInstance::ActiveInstance(ScriptInstance *instance)
{
@@ -51,7 +51,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
/* static */ ScriptInstance *ScriptObject::GetActiveInstance()
{
- assert(ScriptObject::ActiveInstance::active != NULL);
+ assert(ScriptObject::ActiveInstance::active != nullptr);
return ScriptObject::ActiveInstance::active;
}
@@ -296,16 +296,16 @@ ScriptObject::ActiveInstance::~ActiveInstance()
}
/* Set the default callback to return a true/false result of the DoCommand */
- if (callback == NULL) callback = &ScriptInstance::DoCommandReturn;
+ if (callback == nullptr) callback = &ScriptInstance::DoCommandReturn;
/* Are we only interested in the estimate costs? */
- bool estimate_only = GetDoCommandMode() != NULL && !GetDoCommandMode()();
+ bool estimate_only = GetDoCommandMode() != nullptr && !GetDoCommandMode()();
/* Only set p2 when the command does not come from the network. */
if (GetCommandFlags(cmd) & CMD_CLIENT_ID && p2 == 0) p2 = UINT32_MAX;
/* Try to perform the command. */
- CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : NULL, text, false, estimate_only);
+ CommandCost res = ::DoCommandPInternal(tile, p1, p2, cmd, (_networking && !_generating_world) ? ScriptObject::GetActiveInstance()->GetDoCommandCallback() : nullptr, text, false, estimate_only);
/* We failed; set the error and bail out */
if (res.Failed()) {
@@ -328,7 +328,7 @@ ScriptObject::ActiveInstance::~ActiveInstance()
if (_generating_world) {
IncreaseDoCommandCosts(res.GetCost());
- if (callback != NULL) {
+ if (callback != nullptr) {
/* Insert return value into to stack and throw a control code that
* the return value in the stack should be used. */
callback(GetActiveInstance());