aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.World/Pig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Minecraft.World/Pig.cpp')
-rw-r--r--Minecraft.World/Pig.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/Minecraft.World/Pig.cpp b/Minecraft.World/Pig.cpp
index a99af826..cc042f58 100644
--- a/Minecraft.World/Pig.cpp
+++ b/Minecraft.World/Pig.cpp
@@ -64,13 +64,13 @@ bool Pig::canBeControlledByRider()
{
shared_ptr<ItemInstance> item = dynamic_pointer_cast<Player>(rider.lock())->getCarriedItem();
- return item != nullptr && item->id == Item::carrotOnAStick_Id;
+ return item != NULL && item->id == Item::carrotOnAStick_Id;
}
void Pig::defineSynchedData()
{
Animal::defineSynchedData();
- entityData->define(DATA_SADDLE_ID, static_cast<byte>(0));
+ entityData->define(DATA_SADDLE_ID, (byte) 0);
}
void Pig::addAdditonalSaveData(CompoundTag *tag)
@@ -109,7 +109,7 @@ bool Pig::mobInteract(shared_ptr<Player> player)
{
if(!Animal::mobInteract(player))
{
- if (hasSaddle() && !level->isClientSide && (rider.lock() == nullptr || rider.lock() == player))
+ if (hasSaddle() && !level->isClientSide && (rider.lock() == NULL || rider.lock() == player))
{
// 4J HEG - Fixed issue with player not being able to dismount pig (issue #4479)
player->ride( rider.lock() == player ? nullptr : shared_from_this() );
@@ -153,18 +153,18 @@ void Pig::setSaddle(bool value)
{
if (value)
{
- entityData->set(DATA_SADDLE_ID, static_cast<byte>(1));
+ entityData->set(DATA_SADDLE_ID, (byte) 1);
}
else
{
- entityData->set(DATA_SADDLE_ID, static_cast<byte>(0));
+ entityData->set(DATA_SADDLE_ID, (byte) 0);
}
}
void Pig::thunderHit(const LightningBolt *lightningBolt)
{
if (level->isClientSide) return;
- shared_ptr<PigZombie> pz = std::make_shared<PigZombie>(level);
+ shared_ptr<PigZombie> pz = shared_ptr<PigZombie>( new PigZombie(level) );
pz->moveTo(x, y, z, yRot, xRot);
level->addEntity(pz);
remove();
@@ -173,7 +173,7 @@ void Pig::thunderHit(const LightningBolt *lightningBolt)
void Pig::causeFallDamage(float distance)
{
Animal::causeFallDamage(distance);
- if ( (distance > 5) && rider.lock() != nullptr && rider.lock()->instanceof(eTYPE_PLAYER) )
+ if ( (distance > 5) && rider.lock() != NULL && rider.lock()->instanceof(eTYPE_PLAYER) )
{
(dynamic_pointer_cast<Player>(rider.lock()))->awardStat(GenericStats::flyPig(),GenericStats::param_flyPig());
}
@@ -184,7 +184,7 @@ shared_ptr<AgableMob> Pig::getBreedOffspring(shared_ptr<AgableMob> target)
// 4J - added limit to number of animals that can be bred
if( level->canCreateMore( GetType(), Level::eSpawnType_Breed) )
{
- return std::make_shared<Pig>(level);
+ return shared_ptr<Pig>( new Pig(level) );
}
else
{
@@ -194,7 +194,7 @@ shared_ptr<AgableMob> Pig::getBreedOffspring(shared_ptr<AgableMob> target)
bool Pig::isFood(shared_ptr<ItemInstance> itemInstance)
{
- return itemInstance != nullptr && itemInstance->id == Item::carrots_Id;
+ return itemInstance != NULL && itemInstance->id == Item::carrots_Id;
}
ControlledByPlayerGoal *Pig::getControlGoal()