Codechange: Use null pointer literal instead of the NULL macro
This commit is contained in:

committed by
Michael Lutz

parent
3b4f224c0b
commit
7c8e7c6b6e
@@ -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());
|
||||
|
Reference in New Issue
Block a user