diff options
Diffstat (limited to 'src/Mobs/Blaze.cpp')
-rw-r--r-- | src/Mobs/Blaze.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/src/Mobs/Blaze.cpp b/src/Mobs/Blaze.cpp index b771ef7e7..4a87e698b 100644 --- a/src/Mobs/Blaze.cpp +++ b/src/Mobs/Blaze.cpp @@ -21,27 +21,27 @@ cBlaze::cBlaze(void) : -void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer) +bool cBlaze::Attack(std::chrono::milliseconds a_Dt) { - if ((a_Killer != nullptr) && (a_Killer->IsPlayer() || a_Killer->IsA("cWolf"))) + if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0) && (!m_IsCharging)) { - unsigned int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); - AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_BLAZE_ROD); + m_IsCharging = true; + return true; } + return false; } -bool cBlaze::Attack(std::chrono::milliseconds a_Dt) +void cBlaze::GetDrops(cItems & a_Drops, cEntity * a_Killer) { - if ((GetTarget() != nullptr) && (m_AttackCoolDownTicksLeft == 0) && (!m_IsCharging)) + if ((a_Killer != nullptr) && (a_Killer->IsPlayer() || a_Killer->IsA("cWolf"))) { - m_IsCharging = true; - return true; + unsigned int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); + AddRandomDropItem(a_Drops, 0, 1 + LootingLevel, E_ITEM_BLAZE_ROD); } - return false; } @@ -84,6 +84,3 @@ void cBlaze::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) ResetAttackCooldown(); } } - - - |