summaryrefslogtreecommitdiffstats
path: root/source/packets
diff options
context:
space:
mode:
authorlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-28 03:10:05 +0100
committerlapayo94@gmail.com <lapayo94@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2011-12-28 03:10:05 +0100
commit1e9af56a67ae3765291361d9bf01e9009cfb4dcc (patch)
tree65878a8c373ec163eed3439b7db0fc440810d95b /source/packets
parentFixed some things in Core to work for multiple worlds (diff)
downloadcuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.gz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.bz2
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.lz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.xz
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.tar.zst
cuberite-1e9af56a67ae3765291361d9bf01e9009cfb4dcc.zip
Diffstat (limited to '')
-rw-r--r--source/packets/cPacket_Metadata.cpp25
-rw-r--r--source/packets/cPacket_Metadata.h3
2 files changed, 18 insertions, 10 deletions
diff --git a/source/packets/cPacket_Metadata.cpp b/source/packets/cPacket_Metadata.cpp
index 3d3df3b9c..d06bdacbe 100644
--- a/source/packets/cPacket_Metadata.cpp
+++ b/source/packets/cPacket_Metadata.cpp
@@ -1,7 +1,7 @@
#include "cPacket_Metadata.h"
cPacket_Metadata::cPacket_Metadata(int s, int id)
- : EMetaState( (MetaState)s )
+ : m_EMetaData( (cPawn::MetaData)s )
, m_UniqueID( id )
, m_Type( 0 )
, m_MetaData( 0 )
@@ -11,12 +11,12 @@ cPacket_Metadata::cPacket_Metadata(int s, int id)
}
cPacket_Metadata::cPacket_Metadata()
- : EMetaState(NORMAL)
- , m_UniqueID( 0 )
+ : m_UniqueID( 0 )
, m_Type( 0 )
, m_MetaData( 0 )
{
m_PacketID = E_METADATA;
+ m_EMetaData = cPawn::NORMAL;
FormPacket();
}
@@ -30,21 +30,28 @@ void cPacket_Metadata::FormPacket() {
m_MetaDataSize = 3;
//m_UniqueID = GetUniqueID();
m_MetaData[0] = 0x00;
- //m_MetaData[1] = 0x01; //Burning
+
m_MetaData[2] = 0x7f;
- switch(EMetaState) {
- case NORMAL:
+ switch(m_EMetaData) {
+ case cPawn::NORMAL:
m_MetaData[1] = 0x00;
break;
- case BURNING:
+ case cPawn::BURNING:
m_MetaData[1] = 0x01;
break;
- case CROUCHED:
+ case cPawn::CROUCHED:
m_MetaData[1] = 0x02;
break;
- case RIDING:
+ case cPawn::RIDING:
m_MetaData[1] = 0x04;
break;
+ case cPawn::SPRINTING:
+ m_MetaData[1] = 0x08;
+ break;
+ case cPawn::EATING:
+ case cPawn::BLOCKING:
+ m_MetaData[1] = 0x10;
+ break;
default:
m_MetaData[1] = 0x00;
break;
diff --git a/source/packets/cPacket_Metadata.h b/source/packets/cPacket_Metadata.h
index f96178a2c..00d0ae7d3 100644
--- a/source/packets/cPacket_Metadata.h
+++ b/source/packets/cPacket_Metadata.h
@@ -1,6 +1,7 @@
#pragma once
#include "cPacket.h"
#include "PacketID.h"
+#include "cPawn.h"
class cPacket_Metadata : public cPacket
{
@@ -13,7 +14,7 @@ public:
void FormPacket();
virtual cPacket* Clone() const { return new cPacket_Metadata( *this ); }
- enum MetaState{NORMAL,BURNING,CROUCHED,RIDING} EMetaState;
+ cPawn::MetaData m_EMetaData;
static const unsigned int c_Size = 4 + 1;
int m_UniqueID;