diff options
author | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-21 19:05:34 +0100 |
---|---|---|
committer | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-12-21 19:05:34 +0100 |
commit | 994b02f5af05158f6da3964dee5f00e6f00ae981 (patch) | |
tree | 970d2c31a3736e064fc7d6da525bfa0f44c5e606 /source/Mobs/Monster.cpp | |
parent | Added more constants into eEntityType; made them a compulsory parameter to the constructor, so that all entities have proper type. (diff) | |
download | cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar.gz cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar.bz2 cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar.lz cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar.xz cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.tar.zst cuberite-994b02f5af05158f6da3964dee5f00e6f00ae981.zip |
Diffstat (limited to 'source/Mobs/Monster.cpp')
-rw-r--r-- | source/Mobs/Monster.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp index 6c9b870e1..04989caac 100644 --- a/source/Mobs/Monster.cpp +++ b/source/Mobs/Monster.cpp @@ -38,6 +38,8 @@ cMonster::cMonster(void) , m_DestroyTimer( 0 ) , m_Jump(0) , m_MobType( 0 ) + , m_SoundHurt( "" ) + , m_SoundDeath( "" ) , m_EMState(IDLE) , m_SightDistance(25) , m_SeePlayerInterval (0) @@ -303,6 +305,7 @@ void cMonster::HandlePhysics(float a_Dt) void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) { super::DoTakeDamage(a_TDI); + if((m_SoundHurt != "") && (m_Health > 0)) m_World->BroadcastSoundEffect(m_SoundHurt, (int)(m_Pos.x * 8), (int)(m_Pos.y * 8), (int)(m_Pos.z * 8), 1.0f, 0.8f); if (a_TDI.Attacker != NULL) { m_Target = a_TDI.Attacker; @@ -317,6 +320,7 @@ void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) void cMonster::KilledBy(cPawn * a_Killer) { super::KilledBy(a_Killer); + if(m_SoundHurt != "") m_World->BroadcastSoundEffect(m_SoundDeath, (int)(m_Pos.x * 8), (int)(m_Pos.y * 8), (int)(m_Pos.z * 8), 1.0f, 0.8f); m_DestroyTimer = 0; } |