From c5f7f90a90fe42473b880e1eeba8c2efa5885313 Mon Sep 17 00:00:00 2001 From: xen Date: Tue, 25 Oct 2022 04:48:51 +0200 Subject: [PATCH] another patch for viewcontrol so it doesn't break in one unlikely case the player handle is null-checked anyway --- extension.cpp | 22 ++++++++++++++++++---- smsdk_config.h | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/extension.cpp b/extension.cpp index 20fe0a9..0283ec8 100644 --- a/extension.cpp +++ b/extension.cpp @@ -239,6 +239,22 @@ static struct SrcdsPatch 0x800, 100, true, "bin/libtier0_srv.so" }, + // 12: Always transmit point_viewcontrol (for debugging) + { + "_ZN14CTriggerCamera19UpdateTransmitStateEv", + (unsigned char *)"\x74\x16", + "xx", + (unsigned char *)"\xEB\x16", + "cstrike/bin/server_srv.so" + }, + // 13: CTriggerCamera::FollowTarget: Don't early return when the player handle is null + { + "_ZN14CTriggerCamera12FollowTargetEv", + (unsigned char *)"\x74\x1B\x89\xD0\x25\x00\x00\x00\x00\xC1\xE0\x04", + "xxxxx????xxx", + (unsigned char *)"\xEB\x23\x89\xD0\x25\x00\x00\x00\x00\xC1\xE0\x04", + "cstrike/bin/server_srv.so" + }, }; class CBaseEntity; @@ -308,9 +324,7 @@ DETOUR_DECL_MEMBER1(DETOUR_InputTestActivator, void, inputdata_t *, inputdata) DETOUR_MEMBER_CALL(DETOUR_InputTestActivator)(inputdata); } -static constexpr int s_iNonEdicts = 12; - -const char *pszNonEdicts[s_iNonEdicts] = +const char *pszNonEdicts[] = { "ambient_generic", "game_score", @@ -348,7 +362,7 @@ DETOUR_DECL_MEMBER1(DETOUR_PostConstructor, void, const char *, szClassname) } // Remove edicts for a bunch of entities that REALLY don't need them - for (int i = 0; i < s_iNonEdicts; i++) + for (int i = 0; i < sizeof(pszNonEdicts)/sizeof(*pszNonEdicts); i++) { if (!strcasecmp(szClassname, pszNonEdicts[i])) { diff --git a/smsdk_config.h b/smsdk_config.h index 429b2bd..c30d65b 100644 --- a/smsdk_config.h +++ b/smsdk_config.h @@ -40,7 +40,7 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "CSSFixes" #define SMEXT_CONF_DESCRIPTION "Patches bugs in the CSS server binary and more..." -#define SMEXT_CONF_VERSION "1.18" +#define SMEXT_CONF_VERSION "1.19" #define SMEXT_CONF_AUTHOR "BotoX" #define SMEXT_CONF_URL "" #define SMEXT_CONF_LOGTAG "CSSFIXES"