diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/game/MiscHandler.cpp | 5 | ||||
-rw-r--r-- | src/game/Player.h | 2 | ||||
-rw-r--r-- | src/game/UpdateData.cpp | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/game/MiscHandler.cpp b/src/game/MiscHandler.cpp index 2488e7696e0..c2a93c36e0c 100644 --- a/src/game/MiscHandler.cpp +++ b/src/game/MiscHandler.cpp @@ -1018,10 +1018,11 @@ void WorldSession::HandleRequestAccountData(WorldPacket& recv_data) uint32 size = adata->Data.size(); + uLongf destSize = compressBound(size); + ByteBuffer dest; - dest.resize(size); + dest.resize(destSize); - uLongf destSize = size; if(size && compress(const_cast<uint8*>(dest.contents()), &destSize, (uint8*)adata->Data.c_str(), size) != Z_OK) { sLog.outDebug("RAD: Failed to compress account data"); diff --git a/src/game/Player.h b/src/game/Player.h index 85faad96407..49d4c1346b9 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -2462,4 +2462,4 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas basevalue = T((float)basevalue + diff); return T(diff); } -#endif
\ No newline at end of file +#endif diff --git a/src/game/UpdateData.cpp b/src/game/UpdateData.cpp index a3192b74b0e..e461d63e248 100644 --- a/src/game/UpdateData.cpp +++ b/src/game/UpdateData.cpp @@ -128,7 +128,7 @@ bool UpdateData::BuildPacket(WorldPacket *packet) if (pSize > 100 ) // compress large packets { - uint32 destsize = pSize; + uint32 destsize = compressBound(pSize); packet->resize( destsize + sizeof(uint32) ); packet->put<uint32>(0, pSize); |