summaryrefslogtreecommitdiffstats
path: root/src/Mobs
diff options
context:
space:
mode:
authorSamuel Barney <samjbarney@gmail.com>2014-08-21 00:42:30 +0200
committerSamuel Barney <samjbarney@gmail.com>2014-08-21 00:42:30 +0200
commit2c22999486b0b81a138ca380e097fef633ec92ca (patch)
tree8ff9c3769982cb0ceaee7a169db446f45b4cf0c3 /src/Mobs
parentIntegrated NewMonster into the client handle. (diff)
downloadcuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar.gz
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar.bz2
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar.lz
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar.xz
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.tar.zst
cuberite-2c22999486b0b81a138ca380e097fef633ec92ca.zip
Diffstat (limited to 'src/Mobs')
-rw-r--r--src/Mobs/NewMonster.cpp7
-rw-r--r--src/Mobs/NewMonster.h6
2 files changed, 12 insertions, 1 deletions
diff --git a/src/Mobs/NewMonster.cpp b/src/Mobs/NewMonster.cpp
index 14fa54607..cd63fcb6a 100644
--- a/src/Mobs/NewMonster.cpp
+++ b/src/Mobs/NewMonster.cpp
@@ -1,5 +1,6 @@
#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
#include "NewMonster.h"
+#include "../ClientHandle.h"
cNewMonster::cNewMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height)
: super(etMonster, a_Width, a_Height)
@@ -8,3 +9,9 @@ cNewMonster::cNewMonster(const AString & a_ConfigName, eType a_MobType, const AS
, m_SoundDeath(a_SoundDeath)
{
}
+
+void cNewMonster::SpawnOn(cClientHandle & a_Client)
+{
+ a_Client.SendSpawnMob(*this);
+}
+
diff --git a/src/Mobs/NewMonster.h b/src/Mobs/NewMonster.h
index dbc1447ec..9e79d9312 100644
--- a/src/Mobs/NewMonster.h
+++ b/src/Mobs/NewMonster.h
@@ -54,9 +54,13 @@ public:
mtZombiePigman = E_META_SPAWN_EGG_ZOMBIE_PIGMAN,
};
+protected:
+ eType m_MobType;
+public:
cNewMonster(const AString & a_ConfigName, eType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
+ virtual void SpawnOn(cClientHandle & a_ClientHandle) override;
+ eType GetMobType() const { return m_MobType; }
protected:
- eType m_MobType;
AString m_SoundHurt;
AString m_SoundDeath;