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/SpawnEggItem.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/SpawnEggItem.cpp')
| -rw-r--r-- | Minecraft.World/SpawnEggItem.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Minecraft.World/SpawnEggItem.cpp b/Minecraft.World/SpawnEggItem.cpp index 5124f668..9c059126 100644 --- a/Minecraft.World/SpawnEggItem.cpp +++ b/Minecraft.World/SpawnEggItem.cpp @@ -16,7 +16,7 @@ SpawnEggItem::SpawnEggItem(int id) : Item(id) { setMaxStackSize(16); // 4J-PB brought forward. It is 64 on PC, but we'll never be able to place that many setStackedByData(true); - overlay = nullptr; + overlay = NULL; } wstring SpawnEggItem::getHoverName(shared_ptr<ItemInstance> itemInstance) @@ -69,7 +69,7 @@ Icon *SpawnEggItem::getLayerIcon(int auxValue, int spriteLayer) shared_ptr<Entity> SpawnEggItem::canSpawn(int iAuxVal, Level *level, int *piResult) { shared_ptr<Entity> newEntity = EntityIO::newById(iAuxVal, level); - if (newEntity != nullptr) + if (newEntity != NULL) { bool canSpawn = false; @@ -200,7 +200,7 @@ bool SpawnEggItem::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Playe level->removeTile(x,y,z); level->setTileAndData(x,y,z,Tile::mobSpawner_Id, 0, Tile::UPDATE_ALL); shared_ptr<MobSpawnerTileEntity> mste = dynamic_pointer_cast<MobSpawnerTileEntity>( level->getTileEntity(x,y,z) ); - if(mste != nullptr) + if(mste != NULL) { mste->setEntityId( EntityIO::getEncodeId(itemInstance->getAuxValue()) ); return true; @@ -213,7 +213,7 @@ bool SpawnEggItem::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Playe z += Facing::STEP_Z[face]; double yOff = 0; - if (face == Facing::UP && (Tile::tiles[tile] != nullptr && Tile::tiles[tile]->getRenderShape() == Tile::SHAPE_FENCE)) + if (face == Facing::UP && (Tile::tiles[tile] != NULL && Tile::tiles[tile]->getRenderShape() == Tile::SHAPE_FENCE)) { // special case yOff = .5; @@ -224,10 +224,10 @@ bool SpawnEggItem::useOn(shared_ptr<ItemInstance> itemInstance, shared_ptr<Playe if(bTestUseOnOnly) { - return result != nullptr; + return result != NULL; } - if (result != nullptr) + if (result != NULL) { // 4J-JEV: SetCustomName is a method for Mob not LivingEntity; so change instanceof to check for Mobs. if ( result->instanceof(eTYPE_MOB) && itemInstance->hasCustomHoverName() ) @@ -252,7 +252,7 @@ shared_ptr<ItemInstance> SpawnEggItem::use(shared_ptr<ItemInstance> itemInstance if (level->isClientSide) return itemInstance; HitResult *hr = getPlayerPOVHitResult(level, player, true); - if (hr == nullptr) + if (hr == NULL) { delete hr; return itemInstance; @@ -275,7 +275,7 @@ shared_ptr<ItemInstance> SpawnEggItem::use(shared_ptr<ItemInstance> itemInstance { int iResult=0; shared_ptr<Entity> result = spawnMobAt(level, itemInstance->getAuxValue(), xt, yt, zt, &iResult); - if (result != nullptr) + if (result != NULL) { // 4J-JEV: SetCustomName is a method for Mob not LivingEntity; so change instanceof to check for Mobs. if ( result->instanceof(eTYPE_MOB) && itemInstance->hasCustomHoverName() ) @@ -317,7 +317,7 @@ shared_ptr<Entity> SpawnEggItem::spawnMobAt(Level *level, int auxVal, double x, newEntity = canSpawn(mobId, level, piResult); // 4J-JEV: DynCasting to Mob not LivingEntity; so change instanceof to check for Mobs. - if ( newEntity != nullptr && newEntity->instanceof(eTYPE_MOB) ) + if ( newEntity != NULL && newEntity->instanceof(eTYPE_MOB) ) { shared_ptr<Mob> mob = dynamic_pointer_cast<Mob>(newEntity); newEntity->moveTo(x, y, z, Mth::wrapDegrees(level->random->nextFloat() * 360), 0); @@ -325,7 +325,7 @@ shared_ptr<Entity> SpawnEggItem::spawnMobAt(Level *level, int auxVal, double x, mob->yHeadRot = mob->yRot; mob->yBodyRot = mob->yRot; - mob->finalizeMobSpawn(nullptr, extraData); + mob->finalizeMobSpawn(NULL, extraData); level->addEntity(newEntity); mob->playAmbientSound(); } |
