From 37276a4430e26f5b3ab56e07d5f30a194f75982e Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 1 Jul 2013 10:39:56 +0000 Subject: Rewritten entity-on-fire management ("forever on fire" bugs) Fixes FS #297 and part of FS #403. Added sizes to all entities. Moved all damage-related functions from cPawn to cEntity API change: renamed cPawn:TeleportTo() to cEntity:TeleportToCoords() git-svn-id: http://mc-server.googlecode.com/svn/trunk@1635 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Mobs/Monster.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'source/Mobs/Monster.cpp') diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp index 0176175e9..706649cb2 100644 --- a/source/Mobs/Monster.cpp +++ b/source/Mobs/Monster.cpp @@ -22,8 +22,8 @@ -cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath) - : super(etMob) +cMonster::cMonster(const AString & a_ConfigName, char a_ProtocolMobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height) + : super(etMob, a_Width, a_Height) , m_Target(NULL) , m_bMovingToDestination(false) , m_DestinationTime( 0 ) @@ -204,10 +204,13 @@ void cMonster::DoTakeDamage(TakeDamageInfo & a_TDI) -void cMonster::KilledBy(cPawn * a_Killer) +void cMonster::KilledBy(cEntity * a_Killer) { super::KilledBy(a_Killer); - if(m_SoundHurt != "") m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); + if (m_SoundHurt != "") + { + m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); + } m_DestroyTimer = 0; } -- cgit v1.2.3