Fixed splash potion color on toss
This commit is contained in:
parent
c7b7938c04
commit
93c6520e1e
@ -2,11 +2,15 @@
|
||||
|
||||
#include "SplashPotionEntity.h"
|
||||
#include "Pawn.h"
|
||||
#include "../ClientHandle.h"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// Converts an angle in radians into a byte representation used by the network protocol
|
||||
#define ANGLE_TO_PROTO(X) (Byte)(X * 255 / 360)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cSplashPotionEntityCallback:
|
||||
|
||||
@ -118,3 +122,13 @@ void cSplashPotionEntity::Splash(const Vector3d & a_HitPos)
|
||||
|
||||
|
||||
|
||||
|
||||
void cSplashPotionEntity::SpawnOn(cClientHandle & a_Client)
|
||||
{
|
||||
a_Client.SendSpawnObject(*this, 73, m_PotionParticleType, ANGLE_TO_PROTO(GetYaw()), ANGLE_TO_PROTO(GetPitch()));
|
||||
a_Client.SendEntityMetadata(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -56,4 +56,6 @@ protected:
|
||||
/** Splashes the potion, fires its particle effects and sounds
|
||||
@param a_HitPos The position where the potion will splash */
|
||||
void Splash(const Vector3d & a_HitPos);
|
||||
|
||||
virtual void SpawnOn(cClientHandle & a_Client) override;
|
||||
} ; // tolua_export
|
||||
|
Loading…
Reference in New Issue
Block a user