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 /src/Entities/SplashPotionEntity.cpp | |
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 |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/SplashPotionEntity.cpp | 14 |
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); +} + + + + |