diff options
author | madmaxoft <github@xoft.cz> | 2014-07-18 23:20:42 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-18 23:20:42 +0200 |
commit | 19d012c96ec13498d97d8e43136cc09eca3dca2e (patch) | |
tree | 4ef70b4e9d3ca949ca3ff8345ab5045e6077086b /src/Mobs | |
parent | Slime sizes are 1, 2 or 4 and not 1, 2 or 3. (diff) | |
download | cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar.gz cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar.bz2 cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar.lz cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar.xz cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.tar.zst cuberite-19d012c96ec13498d97d8e43136cc09eca3dca2e.zip |
Diffstat (limited to 'src/Mobs')
-rw-r--r-- | src/Mobs/Monster.cpp | 4 | ||||
-rw-r--r-- | src/Mobs/Slime.cpp | 4 | ||||
-rw-r--r-- | src/Mobs/Slime.h | 7 |
3 files changed, 10 insertions, 5 deletions
diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 2a796e8eb..19851e064 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,13 +867,13 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(1 << Random.NextInt(3)); + toReturn = new cSlime(1 << Random.NextInt(3)); // Size 1, 2 or 4 break; } case mtSkeleton: { // TODO: Actual detection of spawning in Nether - toReturn = new cSkeleton(Random.NextInt(1) == 0 ? false : true); + toReturn = new cSkeleton((Random.NextInt(1) == 0) ? false : true); break; } case mtVillager: diff --git a/src/Mobs/Slime.cpp b/src/Mobs/Slime.cpp index 4b123df12..b709ec664 100644 --- a/src/Mobs/Slime.cpp +++ b/src/Mobs/Slime.cpp @@ -48,9 +48,9 @@ void cSlime::GetDrops(cItems & a_Drops, cEntity * a_Killer) void cSlime::Attack(float a_Dt) { - if (m_Size != 1) + if (m_Size > 1) { - // Only slimes with the size 2 and 3 attacks a player. + // Only slimes larger than size 1 attack a player. super::Attack(a_Dt); } } diff --git a/src/Mobs/Slime.h b/src/Mobs/Slime.h index b0e2f627c..15ae113dc 100644 --- a/src/Mobs/Slime.h +++ b/src/Mobs/Slime.h @@ -18,16 +18,21 @@ public: CLASS_PROTODEF(cSlime); + // cAggressiveMonster overrides: virtual void GetDrops(cItems & a_Drops, cEntity * a_Killer = NULL) override; virtual void Attack(float a_Dt) override; virtual void KilledBy(TakeDamageInfo & a_TDI) override; int GetSize(void) const { return m_Size; } + + /** Returns the text describing the slime's size, as used by the client's resource subsystem for sounds. + Returns either "big" or "small". */ const AString GetSizeName(int a_Size) const; protected: - /** Size of the slime, 1 .. 3, with 1 being the smallest */ + /** Size of the slime, with 1 being the smallest. + Vanilla uses sizes 1, 2 and 4 only. */ int m_Size; } ; |