summaryrefslogtreecommitdiffstats
path: root/src/Mobs/Witch.cpp
diff options
context:
space:
mode:
authorTheJumper <maximilian.springer@web.de>2014-02-23 19:35:56 +0100
committerTheJumper <maximilian.springer@web.de>2014-02-23 19:35:56 +0100
commit2f59517023765e8f5d5555adacafd146729ab071 (patch)
treebb5202265e994a69e16041a86e8199563ee6e940 /src/Mobs/Witch.cpp
parentAdded static Enchantment Constants, Replaced cryptic Looting ID (diff)
downloadcuberite-2f59517023765e8f5d5555adacafd146729ab071.tar
cuberite-2f59517023765e8f5d5555adacafd146729ab071.tar.gz
cuberite-2f59517023765e8f5d5555adacafd146729ab071.tar.bz2
cuberite-2f59517023765e8f5d5555adacafd146729ab071.tar.lz
cuberite-2f59517023765e8f5d5555adacafd146729ab071.tar.xz
cuberite-2f59517023765e8f5d5555adacafd146729ab071.tar.zst
cuberite-2f59517023765e8f5d5555adacafd146729ab071.zip
Diffstat (limited to 'src/Mobs/Witch.cpp')
-rw-r--r--src/Mobs/Witch.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/Mobs/Witch.cpp b/src/Mobs/Witch.cpp
index 6cb103645..6956f7b7a 100644
--- a/src/Mobs/Witch.cpp
+++ b/src/Mobs/Witch.cpp
@@ -18,7 +18,11 @@ cWitch::cWitch(void) :
void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
{
- int LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(E_ENCHANTMENT_LOOTING);
+ int LootingLevel = 0;
+ if (a_Killer != NULL)
+ {
+ LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting);
+ }
MTRand r1;
int DropTypeCount = (r1.randInt() % 3) + 1;
for (int i = 0; i < DropTypeCount; i++)
@@ -26,18 +30,16 @@ void cWitch::GetDrops(cItems & a_Drops, cEntity * a_Killer)
int DropType = r1.randInt() % 7;
switch (DropType)
{
- case 0: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLASS_BOTTLE);
- case 1: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLOWSTONE_DUST);
- case 2: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER);
- case 3: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_REDSTONE_DUST);
- case 4: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SPIDER_EYE);
- case 5: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STICK);
- case 6: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SUGAR);
+ case 0: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLASS_BOTTLE); break;
+ case 1: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GLOWSTONE_DUST); break;
+ case 2: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_GUNPOWDER); break;
+ case 3: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_REDSTONE_DUST); break;
+ case 4: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SPIDER_EYE); break;
+ case 5: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_STICK); break;
+ case 6: AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SUGAR); break;
}
}
- cItems RareDrops;
- if (!GetEquippedWeapon().IsEmpty()) RareDrops.Add(GetEquippedWeapon());
- AddRandomRareDropItem(a_Drops, RareDrops, LootingLevel);
+ AddRandomWeaponDropItem(a_Drops, LootingLevel);
}