1
0

Added sounds to levers and mobs

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1093 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
luksor111@gmail.com
2012-12-21 18:05:34 +00:00
parent afaf104b40
commit 994b02f5af
23 changed files with 57 additions and 1 deletions

View File

@@ -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;
}