summaryrefslogtreecommitdiffstats
path: root/src
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
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 'src')
-rw-r--r--src/Entities/SplashPotionEntity.cpp14
-rw-r--r--src/Entities/SplashPotionEntity.h2
2 files changed, 16 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);
+}
+
+
+
+
diff --git a/src/Entities/SplashPotionEntity.h b/src/Entities/SplashPotionEntity.h
index 2c78b55d2..1e056de68 100644
--- a/src/Entities/SplashPotionEntity.h
+++ b/src/Entities/SplashPotionEntity.h
@@ -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