diff options
author | archshift <admin@archshift.com> | 2014-07-19 11:46:31 +0200 |
---|---|---|
committer | archshift <admin@archshift.com> | 2014-07-19 11:46:31 +0200 |
commit | 93c6520e1e6fa957c5d7b7aee71b7ae7e462d77d (patch) | |
tree | 11c24e2045e9ff2ae4ea29df0038d3973108ef77 | |
parent | Renamed AllToLua_lua script. (diff) | |
download | cuberite-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 |
-rw-r--r-- | src/Entities/SplashPotionEntity.cpp | 14 | ||||
-rw-r--r-- | src/Entities/SplashPotionEntity.h | 2 |
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 |