From 6183ec6fa86f797d148e621be15a8788af06930e Mon Sep 17 00:00:00 2001 From: arthurdead Date: Sun, 1 May 2022 22:44:35 -0300 Subject: [PATCH] disable color detection because it doenst work, fix per-client callbacks getting client -1, always change the edict state --- extension.cpp | 6 ++++-- sourcemod/scripting/include/proxysend.inc | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/extension.cpp b/extension.cpp index 1d323f5..924819d 100644 --- a/extension.cpp +++ b/extension.cpp @@ -188,6 +188,7 @@ static prop_types guess_prop_type(const SendProp *pProp) noexcept } } + #if 0 { if(pProp->m_nBits == 32) { struct dummy_t { @@ -201,6 +202,7 @@ static prop_types guess_prop_type(const SendProp *pProp) noexcept } } } + #endif return prop_types::unsigned_int; } @@ -676,7 +678,7 @@ struct callback_t final : prop_reference_t void proxy_call(const SendProp *pProp, const void *pStructBase, const void *pData, DVariant *pOut, int iElement, int objectID) const noexcept { - if(!fwd) { + if(!fwd || (has_any_per_client_func() && get_current_client_entity() == -1)) { restore->pRealProxy(pProp, pStructBase, pData, pOut, iElement, objectID); return; } @@ -1026,8 +1028,8 @@ DETOUR_DECL_STATIC3(SV_ComputeClientPacks, void, int, clientCount, CGameClient * edict_t *edict{gamehelpers->EdictOfIndex(snapshot->m_pValidEntities[i])}; bool any_per_client{false}; for(const auto &it_callback : it_hook->second.callbacks) { + gamehelpers->SetEdictStateChanged(edict, it_callback.second.offset); if(it_callback.second.has_any_per_client_func()) { - gamehelpers->SetEdictStateChanged(edict, it_callback.second.offset); any_per_client = true; } } diff --git a/sourcemod/scripting/include/proxysend.inc b/sourcemod/scripting/include/proxysend.inc index 45cec08..fda3c08 100644 --- a/sourcemod/scripting/include/proxysend.inc +++ b/sourcemod/scripting/include/proxysend.inc @@ -9,7 +9,7 @@ typeset proxysend_callbacks function Action (int entity, const char[] prop, bool &value, int element, int client); function Action (int entity, const char[] prop, float &value, int element, int client); function Action (int entity, const char[] prop, float value[3], int element, int client); - function Action (int entity, const char[] prop, int &r, int &g, int &b, int &a, int element, int client); + //function Action (int entity, const char[] prop, int &r, int &g, int &b, int &a, int element, int client); function Action (int entity, const char[] prop, char[] value, int size, int element, int client); };