1
0

Implented SendExperienceOrb in ClientHandle.

This commit is contained in:
STRWarrior 2013-11-25 20:04:39 +01:00
parent b93d1b5027
commit f86f67907c
4 changed files with 15 additions and 0 deletions

View File

@ -1885,6 +1885,15 @@ void cClientHandle::SendExperience(void)
void cClientHandle::SendExperienceOrb(const cEntity & a_Entity)
{
m_Protocol->SendExperienceOrb(a_Entity);
}
void cClientHandle::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) void cClientHandle::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch)
{ {
m_Protocol->SendSoundEffect(a_SoundName, a_SrcX, a_SrcY, a_SrcZ, a_Volume, a_Pitch); m_Protocol->SendSoundEffect(a_SoundName, a_SrcX, a_SrcY, a_SrcZ, a_Volume, a_Pitch);

View File

@ -121,6 +121,7 @@ public:
void SendPlayerSpawn (const cPlayer & a_Player); void SendPlayerSpawn (const cPlayer & a_Player);
void SendRespawn (void); void SendRespawn (void);
void SendExperience (void); void SendExperience (void);
void SendExperienceOrb (const cEntity & a_Entity);
void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8 void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8
void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data); void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock); void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);

View File

@ -74,6 +74,7 @@ public:
etBoat, etBoat,
etTNT, etTNT,
etProjectile, etProjectile,
etExpOrb,
// Common variations // Common variations
etMob = etMonster, // DEPRECATED, use etMonster instead! etMob = etMonster, // DEPRECATED, use etMonster instead!

View File

@ -7,6 +7,7 @@
#include "../ClientHandle.h" #include "../ClientHandle.h"
#include "../World.h" #include "../World.h"
#include "../Entities/Player.h" #include "../Entities/Player.h"
#include "../Entities/ExpOrb.h"
#include "../Defines.h" #include "../Defines.h"
#include "../MonsterConfig.h" #include "../MonsterConfig.h"
#include "../MersenneTwister.h" #include "../MersenneTwister.h"
@ -258,6 +259,9 @@ void cMonster::KilledBy(cEntity * a_Killer)
{ {
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f); m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
} }
// ToDo: Proper Exp per mob.
cExpOrb * ExpOrb = new cExpOrb(GetPosX(), GetPosY(), GetPosZ(), 1);
ExpOrb->Initialize(m_World);
m_DestroyTimer = 0; m_DestroyTimer = 0;
} }