aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/ControlledByPlayerGoal.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-07 21:12:22 -0600
commit087b7e7abfe81dd7f0fdcdea36ac9f245950df1a (patch)
tree69454763e73ca764af4e682d3573080b13138a0e /Minecraft.World/ControlledByPlayerGoal.cpp
parenta9be52c41a02d207233199e98898fe7483d7e817 (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/ControlledByPlayerGoal.cpp')
-rw-r--r--Minecraft.World/ControlledByPlayerGoal.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.World/ControlledByPlayerGoal.cpp b/Minecraft.World/ControlledByPlayerGoal.cpp
index c5203e6e..cea227cd 100644
--- a/Minecraft.World/ControlledByPlayerGoal.cpp
+++ b/Minecraft.World/ControlledByPlayerGoal.cpp
@@ -36,13 +36,13 @@ void ControlledByPlayerGoal::stop()
bool ControlledByPlayerGoal::canUse()
{
- return mob->isAlive() && mob->rider.lock() != nullptr && mob->rider.lock()->instanceof(eTYPE_PLAYER) && (boosting || mob->canBeControlledByRider());
+ return mob->isAlive() && mob->rider.lock() != NULL && mob->rider.lock()->instanceof(eTYPE_PLAYER) && (boosting || mob->canBeControlledByRider());
}
void ControlledByPlayerGoal::tick()
{
shared_ptr<Player> player = dynamic_pointer_cast<Player>(mob->rider.lock());
- PathfinderMob *pig = static_cast<PathfinderMob *>(mob);
+ PathfinderMob *pig = (PathfinderMob *)mob;
float yrd = Mth::wrapDegrees(player->yRot - mob->yRot) * 0.5f;
if (yrd > 5) yrd = 5;
@@ -62,7 +62,7 @@ void ControlledByPlayerGoal::tick()
{
boosting = false;
}
- moveSpeed += moveSpeed * 1.15f * Mth::sin(static_cast<float>(boostTime) / boostTimeTotal * PI);
+ moveSpeed += moveSpeed * 1.15f * Mth::sin((float) boostTime / boostTimeTotal * PI);
}
float friction = 0.91f;
@@ -117,13 +117,13 @@ void ControlledByPlayerGoal::tick()
{
shared_ptr<ItemInstance> carriedItem = player->getCarriedItem();
- if (carriedItem != nullptr && carriedItem->id == Item::carrotOnAStick_Id)
+ if (carriedItem != NULL && carriedItem->id == Item::carrotOnAStick_Id)
{
carriedItem->hurtAndBreak(1, player);
if (carriedItem->count == 0)
{
- shared_ptr<ItemInstance> replacement = std::make_shared<ItemInstance>(Item::fishingRod);
+ shared_ptr<ItemInstance> replacement = shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod));
replacement->setTag(carriedItem->tag);
player->inventory->items[player->inventory->selected] = replacement;
}
@@ -135,7 +135,7 @@ void ControlledByPlayerGoal::tick()
bool ControlledByPlayerGoal::isNoJumpTile(int tile)
{
- return Tile::tiles[tile] != nullptr && (Tile::tiles[tile]->getRenderShape() == Tile::SHAPE_STAIRS || (dynamic_cast<HalfSlabTile *>(Tile::tiles[tile]) != nullptr) );
+ return Tile::tiles[tile] != NULL && (Tile::tiles[tile]->getRenderShape() == Tile::SHAPE_STAIRS || (dynamic_cast<HalfSlabTile *>(Tile::tiles[tile]) != NULL) );
}
bool ControlledByPlayerGoal::isBoosting()