diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-12-06 18:41:48 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-12-06 18:41:48 +0100 |
commit | 3acdf25b058bceef3005eead6e909c27c7a9e4a8 (patch) | |
tree | 38c40774061bd44b3452091092a018c53459907b /src/Mobs/Monster.cpp | |
parent | Tools: Removed unused Timer.* file from CMakeLists.txt. (diff) | |
parent | Merge pull request #1647 from mc-server/SocketThreadsFix (diff) | |
download | cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar.gz cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar.bz2 cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar.lz cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar.xz cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.tar.zst cuberite-3acdf25b058bceef3005eead6e909c27c7a9e4a8.zip |
Diffstat (limited to 'src/Mobs/Monster.cpp')
-rw-r--r-- | src/Mobs/Monster.cpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index a1122fb31..7b8f763af 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -266,7 +266,9 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) } if ((m_Target != nullptr) && m_Target->IsDestroyed()) + { m_Target = nullptr; + } // Burning in daylight HandleDaylightBurning(a_Chunk); @@ -1027,22 +1029,34 @@ void cMonster::AddRandomArmorDropItem(cItems & a_Drops, short a_LootingLevel) MTRand r1; if (r1.randInt() % 200 < ((m_DropChanceHelmet * 200) + (a_LootingLevel * 2))) { - if (!GetEquippedHelmet().IsEmpty()) a_Drops.push_back(GetEquippedHelmet()); + if (!GetEquippedHelmet().IsEmpty()) + { + a_Drops.push_back(GetEquippedHelmet()); + } } if (r1.randInt() % 200 < ((m_DropChanceChestplate * 200) + (a_LootingLevel * 2))) { - if (!GetEquippedChestplate().IsEmpty()) a_Drops.push_back(GetEquippedChestplate()); + if (!GetEquippedChestplate().IsEmpty()) + { + a_Drops.push_back(GetEquippedChestplate()); + } } if (r1.randInt() % 200 < ((m_DropChanceLeggings * 200) + (a_LootingLevel * 2))) { - if (!GetEquippedLeggings().IsEmpty()) a_Drops.push_back(GetEquippedLeggings()); + if (!GetEquippedLeggings().IsEmpty()) + { + a_Drops.push_back(GetEquippedLeggings()); + } } if (r1.randInt() % 200 < ((m_DropChanceBoots * 200) + (a_LootingLevel * 2))) { - if (!GetEquippedBoots().IsEmpty()) a_Drops.push_back(GetEquippedBoots()); + if (!GetEquippedBoots().IsEmpty()) + { + a_Drops.push_back(GetEquippedBoots()); + } } } @@ -1055,7 +1069,10 @@ void cMonster::AddRandomWeaponDropItem(cItems & a_Drops, short a_LootingLevel) MTRand r1; if (r1.randInt() % 200 < ((m_DropChanceWeapon * 200) + (a_LootingLevel * 2))) { - if (!GetEquippedWeapon().IsEmpty()) a_Drops.push_back(GetEquippedWeapon()); + if (!GetEquippedWeapon().IsEmpty()) + { + a_Drops.push_back(GetEquippedWeapon()); + } } } |