diff --git a/components/openmw-mp/Packets/BasePacket.hpp b/components/openmw-mp/Packets/BasePacket.hpp index 8dd964a03..e02d9ed02 100644 --- a/components/openmw-mp/Packets/BasePacket.hpp +++ b/components/openmw-mp/Packets/BasePacket.hpp @@ -80,11 +80,17 @@ namespace mwmp { if (write) { - RakNet::RakString rstr("%s", str.c_str()); if (compress) - rstr.SerializeCompressed(bs); + { + if (!str.empty()) + RakNet::RakString::SerializeCompressed(str.c_str(), bs); + } else + { + RakNet::RakString rstr; + rstr = str.c_str(); bs->Write(rstr); + } } else {