Fixed errors with SendConVarValue on CS:GO (bug 5638, r=asherkin).

This commit is contained in:
Nicholas Hastings 2013-03-18 11:47:55 -04:00
parent b46f2d1527
commit e487007960

View File

@ -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);