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 a9be52c41a.
This commit is contained in:
Loki Rautio
2026-03-07 21:12:22 -06:00
parent a9be52c41a
commit 087b7e7abf
1373 changed files with 19449 additions and 19903 deletions

View File

@@ -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()