summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Blaze.cpp
diff options
context:
space:
mode:
authorRorkh <rorkh@internet.ru>2021-09-18 11:10:31 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2021-10-02 22:18:18 +0200
commit4c5d9d38f45ae7c18a3e9799152305757a8a1d2a (patch)
tree6c369d0901427be8ab92bef9cd229e60a21486a0 /src/Mobs/Blaze.cpp
parentSnipe skeleton achievment (diff)
downloadcuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.gz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.bz2
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.lz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.xz
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.tar.zst
cuberite-4c5d9d38f45ae7c18a3e9799152305757a8a1d2a.zip
Diffstat (limited to '')
-rw-r--r--src/Mobs/Blaze.cpp21
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();
}
}
-
-
-