diff options
| author | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
|---|---|---|
| committer | Loki Rautio <lokirautio@gmail.com> | 2026-03-07 21:12:22 -0600 |
| commit | 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch) | |
| tree | 69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/DoorInteractGoal.cpp | |
| parent | a9be52c41a02d207233199e98898fe7483d7e817 (diff) | |
Revert "Project modernization (#630)"
This code was not tested and breaks in Release builds, reverting to restore
functionality of the nightly. All in-game menus do not work and generating
a world crashes.
This reverts commit a9be52c41a02d207233199e98898fe7483d7e817.
Diffstat (limited to 'Minecraft.World/DoorInteractGoal.cpp')
| -rw-r--r-- | Minecraft.World/DoorInteractGoal.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/DoorInteractGoal.cpp b/Minecraft.World/DoorInteractGoal.cpp index 45805744..1e3bfe11 100644 --- a/Minecraft.World/DoorInteractGoal.cpp +++ b/Minecraft.World/DoorInteractGoal.cpp @@ -9,7 +9,7 @@ DoorInteractGoal::DoorInteractGoal(Mob *mob) { doorX = doorY = doorZ = 0; - doorTile = nullptr; + doorTile = NULL; passed = false; doorOpenDirX = doorOpenDirZ = 0.0f; @@ -21,7 +21,7 @@ bool DoorInteractGoal::canUse() if (!mob->horizontalCollision) return false; PathNavigation *pathNav = mob->getNavigation(); Path *path = pathNav->getPath(); - if (path == nullptr || path->isDone() || !pathNav->canOpenDoors()) return false; + if (path == NULL || path->isDone() || !pathNav->canOpenDoors()) return false; for (int i = 0; i < min(path->getIndex() + 2, path->getSize()); ++i) { @@ -31,7 +31,7 @@ bool DoorInteractGoal::canUse() doorZ = n->z; if (mob->distanceToSqr(doorX, mob->y, doorZ) > 1.5 * 1.5) continue; doorTile = getDoorTile(doorX, doorY, doorZ); - if (doorTile == nullptr) continue; + if (doorTile == NULL) continue; return true; } @@ -39,7 +39,7 @@ bool DoorInteractGoal::canUse() doorY = Mth::floor(mob->y + 1); doorZ = Mth::floor(mob->z); doorTile = getDoorTile(doorX, doorY, doorZ); - return doorTile != nullptr; + return doorTile != NULL; } bool DoorInteractGoal::canContinueToUse() @@ -50,14 +50,14 @@ bool DoorInteractGoal::canContinueToUse() void DoorInteractGoal::start() { passed = false; - doorOpenDirX = static_cast<float>(doorX + 0.5f - mob->x); - doorOpenDirZ = static_cast<float>(doorZ + 0.5f - mob->z); + doorOpenDirX = (float) (doorX + 0.5f - mob->x); + doorOpenDirZ = (float) (doorZ + 0.5f - mob->z); } void DoorInteractGoal::tick() { - float newDoorDirX = static_cast<float>(doorX + 0.5f - mob->x); - float newDoorDirZ = static_cast<float>(doorZ + 0.5f - mob->z); + float newDoorDirX = (float) (doorX + 0.5f - mob->x); + float newDoorDirZ = (float) (doorZ + 0.5f - mob->z); float dot = doorOpenDirX * newDoorDirX + doorOpenDirZ * newDoorDirZ; if (dot < 0) { @@ -68,6 +68,6 @@ void DoorInteractGoal::tick() DoorTile *DoorInteractGoal::getDoorTile(int x, int y, int z) { int tileId = mob->level->getTile(x, y, z); - if (tileId != Tile::door_wood_Id) return nullptr; - return static_cast<DoorTile *>(Tile::tiles[tileId]); + if (tileId != Tile::door_wood_Id) return NULL; + return (DoorTile *) Tile::tiles[tileId]; }
\ No newline at end of file |
