From 509d3d3b62c2dc5b328cf122c0fc5f0595b73721 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 18 Jul 2014 16:55:28 +0200 Subject: Slime sizes are 1, 2 or 4 and not 1, 2 or 3. --- src/Mobs/Monster.cpp | 2 +- src/Mobs/Slime.cpp | 4 ++-- src/Mobs/Slime.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e36634c73..2a796e8eb 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,7 +867,7 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(Random.NextInt(2) + 1); + toReturn = new cSlime(1 << Random.NextInt(3)); break; } case mtSkeleton: diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 4e12fca51..4b123df12 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -9,7 +9,6 @@ -/// Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest cSlime::cSlime(int a_Size) : super("Slime", mtSlime, @@ -36,7 +35,8 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) LootingLevel = a_Killer->GetEquippedWeapon().m_Enchantments.GetLevel(cEnchantments::enchLooting); } - if (GetSize() == 1) + // Only slimes with the size 1 can drop slimeballs. + if (m_Size == 1) { AddRandomDropItem(a_Drops, 0, 2 + LootingLevel, E_ITEM_SLIMEBALL); } diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index 87c5a8e5e..b0e2f627c 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -13,7 +13,7 @@ class cSlime : typedef cAggressiveMonster super; public: - /** Creates a slime of the specified size; size is 1 .. 3, with 1 being the smallest */ + /** Creates a slime of the specified size; size can be 1, 2 or 4, with 1 is the smallest and 4 is the tallest. */ cSlime(int a_Size); CLASS_PROTODEF(cSlime); -- cgit v1.2.3