diff options
| author | qwasdrizzel <145519042+qwasdrizzel@users.noreply.github.com> | 2026-03-16 21:44:26 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-03-16 21:44:26 -0500 |
| commit | ce739f6045ec72127491286ea3f3f21e537c1b55 (patch) | |
| tree | f33bd42a47c1b4a7b2153a7fb77127ee3b407db9 /Minecraft.World/MoveIndoorsGoal.cpp | |
| parent | 255a18fe8e9b57377975f82e2b227afe2a12eda0 (diff) | |
| parent | 5a59f5d146b43811dde6a5a0245ee9875d7b5cd1 (diff) | |
Merge branch 'smartcmd:main' into main
Diffstat (limited to 'Minecraft.World/MoveIndoorsGoal.cpp')
| -rw-r--r-- | Minecraft.World/MoveIndoorsGoal.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Minecraft.World/MoveIndoorsGoal.cpp b/Minecraft.World/MoveIndoorsGoal.cpp index 395fe578..f329a6bb 100644 --- a/Minecraft.World/MoveIndoorsGoal.cpp +++ b/Minecraft.World/MoveIndoorsGoal.cpp @@ -22,10 +22,10 @@ bool MoveIndoorsGoal::canUse() if (mob->getRandom()->nextInt(50) != 0) return false; if (insideX != -1 && mob->distanceToSqr(insideX, mob->y, insideZ) < 2 * 2) return false; shared_ptr<Village> village = mob->level->villages->getClosestVillage(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z), 14); - if (village == NULL) return false; + if (village == nullptr) return false; shared_ptr<DoorInfo> _doorInfo = village->getBestDoorInfo(Mth::floor(mob->x), Mth::floor(mob->y), Mth::floor(mob->z)); doorInfo = _doorInfo; - return _doorInfo != NULL; + return _doorInfo != nullptr; } bool MoveIndoorsGoal::canContinueToUse() @@ -37,7 +37,7 @@ void MoveIndoorsGoal::start() { insideX = -1; shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); - if( _doorInfo == NULL ) + if( _doorInfo == nullptr ) { doorInfo = weak_ptr<DoorInfo>(); return; @@ -45,7 +45,7 @@ void MoveIndoorsGoal::start() if (mob->distanceToSqr(_doorInfo->getIndoorX(), _doorInfo->y, _doorInfo->getIndoorZ()) > 16 * 16) { Vec3 *pos = RandomPos::getPosTowards(dynamic_pointer_cast<PathfinderMob>(mob->shared_from_this()), 14, 3, Vec3::newTemp(_doorInfo->getIndoorX() + 0.5, _doorInfo->getIndoorY(), _doorInfo->getIndoorZ() + 0.5)); - if (pos != NULL) mob->getNavigation()->moveTo(pos->x, pos->y, pos->z, 1.0f); + if (pos != nullptr) mob->getNavigation()->moveTo(pos->x, pos->y, pos->z, 1.0f); } else mob->getNavigation()->moveTo(_doorInfo->getIndoorX() + 0.5, _doorInfo->getIndoorY(), _doorInfo->getIndoorZ() + 0.5, 1.0f); } @@ -53,7 +53,7 @@ void MoveIndoorsGoal::start() void MoveIndoorsGoal::stop() { shared_ptr<DoorInfo> _doorInfo = doorInfo.lock(); - if( _doorInfo == NULL ) + if( _doorInfo == nullptr ) { doorInfo = weak_ptr<DoorInfo>(); return; |
