summaryrefslogtreecommitdiff
path: root/src/script/api/script_group.cpp
diff options
context:
space:
mode:
authorHenry Wilson <m3henry@googlemail.com>2019-04-10 22:07:06 +0100
committerMichael Lutz <michi@icosahedron.de>2019-04-10 23:22:20 +0200
commit7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch)
tree99f134b7e66367cf11e10bc5061896eab4a3264f /src/script/api/script_group.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/script/api/script_group.cpp')
-rw-r--r--src/script/api/script_group.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/api/script_group.cpp b/src/script/api/script_group.cpp
index fcae6c3d2..55f5ffdeb 100644
--- a/src/script/api/script_group.cpp
+++ b/src/script/api/script_group.cpp
@@ -25,12 +25,12 @@
/* static */ bool ScriptGroup::IsValidGroup(GroupID group_id)
{
const Group *g = ::Group::GetIfValid(group_id);
- return g != NULL && g->owner == ScriptObject::GetCompany();
+ return g != nullptr && g->owner == ScriptObject::GetCompany();
}
/* static */ ScriptGroup::GroupID ScriptGroup::CreateGroup(ScriptVehicle::VehicleType vehicle_type, GroupID parent_group_id)
{
- if (!ScriptObject::DoCommand(0, (::VehicleType)vehicle_type, parent_group_id, CMD_CREATE_GROUP, NULL, &ScriptInstance::DoCommandReturnGroupID)) return GROUP_INVALID;
+ if (!ScriptObject::DoCommand(0, (::VehicleType)vehicle_type, parent_group_id, CMD_CREATE_GROUP, nullptr, &ScriptInstance::DoCommandReturnGroupID)) return GROUP_INVALID;
/* In case of test-mode, we return GroupID 0 */
return (ScriptGroup::GroupID)0;
@@ -55,7 +55,7 @@
CCountedPtr<Text> counter(name);
EnforcePrecondition(false, IsValidGroup(group_id));
- EnforcePrecondition(false, name != NULL);
+ EnforcePrecondition(false, name != nullptr);
const char *text = name->GetDecodedText();
EnforcePreconditionEncodedText(false, text);
EnforcePreconditionCustomError(false, ::Utf8StringLength(text) < MAX_LENGTH_GROUP_NAME_CHARS, ScriptError::ERR_PRECONDITION_STRING_TOO_LONG);
@@ -65,7 +65,7 @@
/* static */ char *ScriptGroup::GetName(GroupID group_id)
{
- if (!IsValidGroup(group_id)) return NULL;
+ if (!IsValidGroup(group_id)) return nullptr;
::SetDParam(0, group_id);
return GetString(STR_GROUP_NAME);