summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol132.cpp
diff options
context:
space:
mode:
authorkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-28 07:08:29 +0200
committerkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-04-28 07:08:29 +0200
commit9e38229b0d37e1a52507325437ccef5e7eb33573 (patch)
tree5d60aa9393208a7b7d166f813194c599878a497a /source/Protocol/Protocol132.cpp
parentAdded initialization of rotation in cEntity. (diff)
downloadcuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar.gz
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar.bz2
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar.lz
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar.xz
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.tar.zst
cuberite-9e38229b0d37e1a52507325437ccef5e7eb33573.zip
Diffstat (limited to '')
-rw-r--r--source/Protocol/Protocol132.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/source/Protocol/Protocol132.cpp b/source/Protocol/Protocol132.cpp
index e051bcfa1..213fa26ae 100644
--- a/source/Protocol/Protocol132.cpp
+++ b/source/Protocol/Protocol132.cpp
@@ -406,12 +406,12 @@ void cProtocol132::SendSpawnMob(const cMonster & a_Mob)
WriteInt (a_Mob.GetUniqueID());
WriteByte (a_Mob.GetMobType());
WriteVectorI((Vector3i)(a_Mob.GetPosition() * 32));
- WriteByte (0); // yaw
- WriteByte (0); // pitch
- WriteByte (0); // head yaw
- WriteShort (0); // Velocity Z
- WriteShort (0); // Velocity X
- WriteShort (0); // Velocity Y
+ WriteByte ((BYTE)((a_Mob.GetRotation() / 360.f) * 256));
+ WriteByte ((BYTE)((a_Mob.GetPitch() / 360.f) * 256));
+ WriteByte ((BYTE)((a_Mob.GetHeadYaw() / 360.f) * 256));
+ WriteShort ((short)(a_Mob.GetSpeedX() * 400));
+ WriteShort ((short)(a_Mob.GetSpeedY() * 400));
+ WriteShort ((short)(a_Mob.GetSpeedZ() * 400));
AString MetaData = GetEntityMetaData(a_Mob);
SendData (MetaData.data(), MetaData.size());
Flush();