summaryrefslogtreecommitdiffstats
path: root/src/Entities/SplashPotionEntity.cpp
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-07-19 11:46:31 +0200
committerarchshift <admin@archshift.com>2014-07-19 11:46:31 +0200
commit93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d (patch)
tree11c24e2045e9ff2ae4ea29df0038d3973108ef77 /src/Entities/SplashPotionEntity.cpp
parentRenamed AllToLua_lua script. (diff)
downloadcuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar.gz
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar.bz2
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar.lz
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar.xz
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.tar.zst
cuberite-93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/SplashPotionEntity.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/Entities/SplashPotionEntity.cpp b/src/Entities/SplashPotionEntity.cpp
index 3efb1f25d..c379ab3fb 100644
--- a/src/Entities/SplashPotionEntity.cpp
+++ b/src/Entities/SplashPotionEntity.cpp
@@ -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);
+}
+
+
+
+