diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-25 09:18:52 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-05-25 09:18:52 +0200 |
commit | a4a418a679f1ac760a8763edd856f0178cfc6dde (patch) | |
tree | 85300ca3a2b3a942998a0c864ae90894857ebf5f /source/packets | |
parent | Fixed output directory structure in the "Release profiled" configuration (diff) | |
download | cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.gz cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.bz2 cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.lz cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.xz cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.tar.zst cuberite-a4a418a679f1ac760a8763edd856f0178cfc6dde.zip |
Diffstat (limited to '')
-rw-r--r-- | source/packets/cPacket.cpp | 9 | ||||
-rw-r--r-- | source/packets/cPacket_MapChunk.cpp | 2 | ||||
-rw-r--r-- | source/packets/cPacket_MapChunk.h | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/source/packets/cPacket.cpp b/source/packets/cPacket.cpp index 284e80903..ec7181762 100644 --- a/source/packets/cPacket.cpp +++ b/source/packets/cPacket.cpp @@ -195,13 +195,14 @@ void cPacket::AppendString(AString & a_Dst, const AString & a_String) void cPacket::AppendString16(AString & a_Dst, const AString & a_String)
{
AppendShort(a_Dst, (unsigned short)a_String.size());
- std::auto_ptr<char> UTF16(new char[a_String.size() * sizeof( short ) ]);
+ AString UTF16;
+ UTF16.resize(a_String.size() * sizeof(short));
for( unsigned int i = 0; i < a_String.size(); ++i )
{
- UTF16.get()[i * sizeof( short )] = 0x00;
- UTF16.get()[i * sizeof( short ) + 1] = a_String[i];
+ UTF16[i * sizeof( short )] = 0x00;
+ UTF16[i * sizeof( short ) + 1] = a_String[i];
}
- a_Dst.append(UTF16.get(), a_String.size() * sizeof(short));
+ a_Dst.append(UTF16.data(), a_String.size() * sizeof(short));
}
diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp index 501e4df2d..279dee808 100644 --- a/source/packets/cPacket_MapChunk.cpp +++ b/source/packets/cPacket_MapChunk.cpp @@ -19,7 +19,7 @@ cPacket_MapChunk::~cPacket_MapChunk() -cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, const BLOCKTYPE * a_BlockData, const BIOMETYPE * a_BiomeData)
+cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, const BLOCKTYPE * a_BlockData, const unsigned char * a_BiomeData)
{
m_PacketID = E_MAP_CHUNK;
diff --git a/source/packets/cPacket_MapChunk.h b/source/packets/cPacket_MapChunk.h index 27e1ec8e5..0daf5af34 100644 --- a/source/packets/cPacket_MapChunk.h +++ b/source/packets/cPacket_MapChunk.h @@ -24,7 +24,7 @@ public: { m_PacketID = E_MAP_CHUNK; }
cPacket_MapChunk( const cPacket_MapChunk & a_Copy );
- cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, const BLOCKTYPE * a_BlockData, const BIOMETYPE * a_BiomeData);
+ cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, const BLOCKTYPE * a_BlockData, const unsigned char * a_BiomeData);
~cPacket_MapChunk();
virtual cPacket* Clone() const { return new cPacket_MapChunk(*this); }
|