From 8fe7f8b8d8a75e0b20ccac7a3c8b756b81900e13 Mon Sep 17 00:00:00 2001 From: Scott Ehlert Date: Tue, 4 May 2010 22:53:26 -0400 Subject: [PATCH] Fixed SendConVarValue() on TF2, DOD:S, L4D, and L4D2 (bug 4273, r=dvander). --- core/smn_console.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/smn_console.cpp b/core/smn_console.cpp index 307feb6a..186a2a0c 100644 --- a/core/smn_console.cpp +++ b/core/smn_console.cpp @@ -2,7 +2,7 @@ * vim: set ts=4 : * ============================================================================= * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. + * Copyright (C) 2004-2010 AlliedModders LLC. All rights reserved. * ============================================================================= * * This program is free software; you can redistribute it and/or modify it under @@ -46,6 +46,12 @@ #include "Logger.h" #include "ConsoleDetours.h" +#if SOURCE_ENGINE >= SE_ORANGEBOXVALVE +#define NETMSG_BITS 6 +#else +#define NETMSG_BITS 5 +#endif + #if (SOURCE_ENGINE == SE_LEFT4DEAD) || (SOURCE_ENGINE == SE_LEFT4DEAD2) #define NET_SETCONVAR 6 #else @@ -189,7 +195,7 @@ static void ReplicateConVar(ConVar *pConVar) char data[256]; bf_write buffer(data, sizeof(data)); - buffer.WriteUBitLong(NET_SETCONVAR, 5); + buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS); buffer.WriteByte(1); buffer.WriteString(pConVar->GetName()); buffer.WriteString(pConVar->GetString()); @@ -1296,7 +1302,7 @@ static cell_t SendConVarValue(IPluginContext *pContext, const cell_t *params) char data[256]; bf_write buffer(data, sizeof(data)); - buffer.WriteUBitLong(NET_SETCONVAR, 5); + buffer.WriteUBitLong(NET_SETCONVAR, NETMSG_BITS); buffer.WriteByte(1); buffer.WriteString(pConVar->GetName()); buffer.WriteString(value);