1
0

1.8: Fixed maps.

This commit is contained in:
Howaner
2014-09-13 02:20:04 +02:00
parent 69afc4dbba
commit b462416e1f
12 changed files with 43 additions and 45 deletions

View File

@@ -728,18 +728,21 @@ void cProtocol180::SendPaintingSpawn(const cPainting & a_Painting)
void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length)
void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length, unsigned int m_Scale)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt(a_ID);
Pkt.WriteShort (3 + a_Length);
Pkt.WriteByte(m_Scale);
Pkt.WriteByte(0);
Pkt.WriteVarInt(0);
Pkt.WriteByte(1);
Pkt.WriteByte(a_Length);
Pkt.WriteByte(a_X);
Pkt.WriteByte(a_Y);
Pkt.WriteVarInt(a_Length);
for (unsigned int i = 0; i < a_Length; ++i)
{
Pkt.WriteByte(a_Colors[i]);
@@ -750,22 +753,23 @@ void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colo
void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators)
void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators, unsigned int m_Scale)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt(a_ID);
Pkt.WriteShort ((short)(1 + (3 * a_Decorators.size())));
Pkt.WriteByte(m_Scale);
Pkt.WriteVarInt(a_Decorators.size());
Pkt.WriteByte(1);
for (cMapDecoratorList::const_iterator it = a_Decorators.begin(); it != a_Decorators.end(); ++it)
{
Pkt.WriteByte((it->GetType() << 4) | (it->GetRot() & 0xf));
Pkt.WriteByte(it->GetPixelX());
Pkt.WriteByte(it->GetPixelZ());
}
Pkt.WriteByte(0);
}
@@ -774,21 +778,16 @@ void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decor
void cProtocol180::SendMapInfo(int a_ID, unsigned int a_Scale)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt(a_ID);
Pkt.WriteShort (2);
UNUSED(a_ID);
UNUSED(a_Scale);
Pkt.WriteByte(2);
Pkt.WriteByte(a_Scale);
// This packet was removed in 1.8
}
void cProtocol180::SendPickupSpawn(const cPickup & a_Pickup)
{
ASSERT(m_State == 3); // In game mode?