diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-19 10:21:39 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-04-19 10:21:39 +0200 |
commit | 9b9a37e5070a4553b0945ea4b770cf75c375bec5 (patch) | |
tree | f869a7f1d8273efd29503a98ad2e74900ec253f8 /source/Protocol/Protocol125.cpp | |
parent | cPlayer now uses BroadcastMovementUpdate during its Tick function (diff) | |
download | cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar.gz cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar.bz2 cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar.lz cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar.xz cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.tar.zst cuberite-9b9a37e5070a4553b0945ea4b770cf75c375bec5.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Protocol/Protocol125.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index e588bc595..184bd1d30 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -352,7 +352,7 @@ void cProtocol125::SendEntityStatus(const cEntity & a_Entity, char a_Status) -void cProtocol125::SendExplosion(double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iList a_BlocksAffected, float a_PlayerMotionX, float a_PlayerMotionY, float a_PlayerMotionZ)
+void cProtocol125::SendExplosion(double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iArray a_BlocksAffected, const Vector3d & a_PlayerMotion)
{
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_EXPLOSION);
@@ -360,19 +360,16 @@ void cProtocol125::SendExplosion(double a_BlockX, double a_BlockY, double a_Bloc WriteDouble (a_BlockY);
WriteDouble (a_BlockZ);
WriteFloat (a_Radius);
- WriteInt (a_BlocksAffected.size());//it should be a_RecordCount
- /*WriteByte (0); //It should be the record
- WriteByte (0);
- WriteByte (0);*/
- for (cVector3iList::iterator itr = a_BlocksAffected.begin(); itr != a_BlocksAffected.end(); ++itr)
+ WriteInt (a_BlocksAffected.size());
+ for (cVector3iArray::const_iterator itr = a_BlocksAffected.begin(); itr != a_BlocksAffected.end(); ++itr)
{
- WriteByte ((Byte)((*itr)->x - a_BlockX));
- WriteByte ((Byte)((*itr)->y - a_BlockY));
- WriteByte ((Byte)((*itr)->z - a_BlockZ));
+ WriteByte ((Byte)(itr->x - a_BlockX));
+ WriteByte ((Byte)(itr->y - a_BlockY));
+ WriteByte ((Byte)(itr->z - a_BlockZ));
}
- WriteFloat (a_PlayerMotionX);
- WriteFloat (a_PlayerMotionY);
- WriteFloat (a_PlayerMotionZ);
+ WriteFloat ((float)a_PlayerMotion.x);
+ WriteFloat ((float)a_PlayerMotion.y);
+ WriteFloat ((float)a_PlayerMotion.z);
Flush();
}
|