From 4a1dd5f5196cf78201d9cf4e15651c7a4cd3a76d Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 18 Dec 2012 17:58:45 -0500 Subject: [PATCH] Added support for new SPROP_VARINT sendprops. --- core/smn_entities.cpp | 16 ++++++++++++++++ extensions/sdktools/gamerulesnatives.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/core/smn_entities.cpp b/core/smn_entities.cpp index e957ed38..7537f950 100644 --- a/core/smn_entities.cpp +++ b/core/smn_entities.cpp @@ -1192,6 +1192,14 @@ static cell_t GetEntProp(IPluginContext *pContext, const cell_t *params) { FIND_PROP_SEND(DPT_Int, "integer"); is_unsigned = ((info.prop->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED); + + // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE + if (info.prop->GetFlags() & SPROP_VARINT) + { + bit_count = sizeof(int) * 8; + } +#endif break; } default: @@ -1282,6 +1290,14 @@ static cell_t SetEntProp(IPluginContext *pContext, const cell_t *params) case Prop_Send: { FIND_PROP_SEND(DPT_Int, "integer"); + + // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE + if (info.prop->GetFlags() & SPROP_VARINT) + { + bit_count = sizeof(int) * 8; + } +#endif break; } default: diff --git a/extensions/sdktools/gamerulesnatives.cpp b/extensions/sdktools/gamerulesnatives.cpp index 9a6de9f7..fc51bd3a 100644 --- a/extensions/sdktools/gamerulesnatives.cpp +++ b/extensions/sdktools/gamerulesnatives.cpp @@ -171,6 +171,14 @@ static cell_t GameRules_GetProp(IPluginContext *pContext, const cell_t *params) FIND_PROP_SEND(DPT_Int, "integer"); is_unsigned = ((info.prop->GetFlags() & SPROP_UNSIGNED) == SPROP_UNSIGNED); + + // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE + if (info.prop->GetFlags() & SPROP_VARINT) + { + bit_count = sizeof(int) * 8; + } +#endif if (bit_count < 1) { bit_count = params[2] * 8; @@ -234,6 +242,14 @@ static cell_t GameRules_SetProp(IPluginContext *pContext, const cell_t *params) FIND_PROP_SEND(DPT_Int, "integer"); + // This isn't in CS:S yet, but will be, doesn't hurt to add now, and will save us a build later +#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_ORANGEBOXVALVE + if (info.prop->GetFlags() & SPROP_VARINT) + { + bit_count = sizeof(int) * 8; + } +#endif + void *pGameRules = *g_pGameRules; if (bit_count < 1)