summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_ship.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/pathfinder/yapf/yapf_ship.cpp
parent3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff)
downloadopenttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/pathfinder/yapf/yapf_ship.cpp')
-rw-r--r--src/pathfinder/yapf/yapf_ship.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/pathfinder/yapf/yapf_ship.cpp b/src/pathfinder/yapf/yapf_ship.cpp
index b880128f5..e7391d686 100644
--- a/src/pathfinder/yapf/yapf_ship.cpp
+++ b/src/pathfinder/yapf/yapf_ship.cpp
@@ -89,13 +89,13 @@ public:
Trackdir next_trackdir = INVALID_TRACKDIR; // this would mean "path not found"
Node *pNode = pf.GetBestNode();
- if (pNode != NULL) {
+ if (pNode != nullptr) {
uint steps = 0;
- for (Node *n = pNode; n->m_parent != NULL; n = n->m_parent) steps++;
+ for (Node *n = pNode; n->m_parent != nullptr; n = n->m_parent) steps++;
/* walk through the path back to the origin */
- Node *pPrevNode = NULL;
- while (pNode->m_parent != NULL) {
+ Node *pPrevNode = nullptr;
+ while (pNode->m_parent != nullptr) {
steps--;
if (steps > 0 && steps < YAPF_SHIP_PATH_CACHE_LENGTH) {
TrackdirByte td;
@@ -138,11 +138,11 @@ public:
if (!pf.FindPath(v)) return false;
Node *pNode = pf.GetBestNode();
- if (pNode == NULL) return false;
+ if (pNode == nullptr) return false;
/* path was found
* walk through the path back to the origin */
- while (pNode->m_parent != NULL) {
+ while (pNode->m_parent != nullptr) {
pNode = pNode->m_parent;
}