summaryrefslogtreecommitdiffstats
path: root/source/Protocol
diff options
context:
space:
mode:
Diffstat (limited to 'source/Protocol')
-rw-r--r--source/Protocol/Protocol.h2
-rw-r--r--source/Protocol/Protocol125.cpp21
-rw-r--r--source/Protocol/Protocol125.h2
-rw-r--r--source/Protocol/ProtocolRecognizer.cpp4
-rw-r--r--source/Protocol/ProtocolRecognizer.h2
5 files changed, 14 insertions, 17 deletions
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h
index 48d32384c..91017dbaf 100644
--- a/source/Protocol/Protocol.h
+++ b/source/Protocol/Protocol.h
@@ -67,7 +67,7 @@ public:
virtual void SendEntRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) = 0;
virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) = 0;
virtual void SendEntityStatus (const cEntity & a_Entity, char a_Status) = 0;
- virtual void 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) = 0;
+ virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iArray a_BlocksAffected, const Vector3d & a_PlayerMotion) = 0;
virtual void SendGameMode (eGameMode a_GameMode) = 0;
virtual void SendHealth (void) = 0;
virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) = 0;
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();
}
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h
index 1cf03357d..b7c5ff424 100644
--- a/source/Protocol/Protocol125.h
+++ b/source/Protocol/Protocol125.h
@@ -44,7 +44,7 @@ public:
virtual void SendEntRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) override;
virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override;
virtual void SendEntityStatus (const cEntity & a_Entity, char a_Status) override;
- virtual void 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) override;
+ virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iArray a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) override;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp
index ea60dafae..cae267524 100644
--- a/source/Protocol/ProtocolRecognizer.cpp
+++ b/source/Protocol/ProtocolRecognizer.cpp
@@ -266,10 +266,10 @@ void cProtocolRecognizer::SendEntityStatus(const cEntity & a_Entity, char a_Stat
-void cProtocolRecognizer::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 cProtocolRecognizer::SendExplosion(double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iArray a_BlocksAffected, const Vector3d & a_PlayerMotion)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendExplosion(a_BlockX,a_BlockY,a_BlockZ,a_Radius, a_BlocksAffected, a_PlayerMotionX, a_PlayerMotionY,a_PlayerMotionZ);
+ m_Protocol->SendExplosion(a_BlockX,a_BlockY,a_BlockZ,a_Radius, a_BlocksAffected, a_PlayerMotion);
}
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h
index f897f1804..1d301394c 100644
--- a/source/Protocol/ProtocolRecognizer.h
+++ b/source/Protocol/ProtocolRecognizer.h
@@ -71,7 +71,7 @@ public:
virtual void SendEntRelMoveLook (const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) override;
virtual void SendEntityEquipment (const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override;
virtual void SendEntityStatus (const cEntity & a_Entity, char a_Status) override;
- virtual void 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) override;
+ virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, cVector3iArray a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
virtual void SendInventoryProgress (char a_WindowID, short a_Progressbar, short a_Value) override;