From e4870079600975281bc7b43f4666ee2a2501efe0 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Mon, 18 Mar 2013 11:47:55 -0400 Subject: [PATCH] Fixed errors with SendConVarValue on CS:GO (bug 5638, r=asherkin). --- core/smn_console.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 55bdf0abb..cc2afd996 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -1437,10 +1437,13 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params) cvar->set_name(pConVar->GetName()); cvar->set_value(value); + + int msgsize = msg.ByteSize(); buffer.WriteVarInt32(net_SetConVar); - buffer.WriteVarInt32(msg.ByteSize()); + buffer.WriteVarInt32(msgsize); msg.SerializeWithCachedSizesToArray( (uint8 *)( buffer.GetBasePointer() + buffer.GetNumBytesWritten() ) ); + buffer.SeekToBit( ( buffer.GetNumBytesWritten() + msgsize ) * 8 ); #else buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS); buffer.WriteByte(1);