diff --git a/src/RakLuaBitStream.cpp b/src/RakLuaBitStream.cpp index bf6a052..e88ea8d 100644 --- a/src/RakLuaBitStream.cpp +++ b/src/RakLuaBitStream.cpp @@ -232,8 +232,8 @@ bool RakLuaBitStream::emulIncomingRPC(uint8_t rpcId) BitStream sendBs; sendBs.Write(ID_RPC); sendBs.Write(rpcId); - sendBs.WriteCompressed(BYTES_TO_BITS(bs->GetNumberOfBytesUsed())); - sendBs.WriteBits(bs->GetData(), BYTES_TO_BITS(bs->GetNumberOfBytesUsed()), false); + sendBs.WriteCompressed(bs->GetNumberOfBitsUsed()); + sendBs.WriteBits(bs->GetData(), bs->GetNumberOfBitsUsed(), false); return reinterpret_cast (gRakLua.getRpcHook()->getTrampoline())(gRakPeer, sendBs.GetData(), sendBs.GetNumberOfBytesUsed(), gPlayerId); }