summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Blaze.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Mobs/Blaze.cpp')
-rw-r--r--src/Mobs/Blaze.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp
index d002e14e7..1fcf086d5 100644
--- a/src/Mobs/Blaze.cpp
+++ b/src/Mobs/Blaze.cpp
@@ -39,17 +39,11 @@ bool cBlaze::Attack(std::chrono::milliseconds a_Dt)
// Setting this higher gives us more wiggle room for attackrate
Vector3d Speed = GetLookVector() * 20;
Speed.y = Speed.y + 1;
- cFireChargeEntity * FireCharge = new cFireChargeEntity(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
- if (FireCharge == nullptr)
+ auto FireCharge = cpp14::make_unique<cFireChargeEntity>(this, GetPosX(), GetPosY() + 1, GetPosZ(), Speed);
+ if (!FireCharge->Initialize(std::move(FireCharge), *m_World))
{
return false;
}
- if (!FireCharge->Initialize(*m_World))
- {
- delete FireCharge;
- FireCharge = nullptr;
- return false;
- }
ResetAttackCooldown();
// ToDo: Shoot 3 fireballs instead of 1.
return true;