From 994b02f5af05158f6da3964dee5f00e6f00ae981 Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Fri, 21 Dec 2012 18:05:34 +0000 Subject: Added sounds to levers and mobs git-svn-id: http://mc-server.googlecode.com/svn/trunk@1093 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Mobs/Monster.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/Mobs/Monster.cpp') 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; } -- cgit v1.2.3