diff --git a/extensions/tf2/conditions.cpp b/extensions/tf2/conditions.cpp index 8076fdeb..b3193b8d 100644 --- a/extensions/tf2/conditions.cpp +++ b/extensions/tf2/conditions.cpp @@ -31,9 +31,6 @@ #include "extension.h" #include "conditions.h" -#include "util.h" - -#include IForward *g_addCondForward = NULL; IForward *g_removeCondForward = NULL; @@ -87,13 +84,13 @@ void PlayerConditionsMgr::ProcessCondChange(CondChangeData_t *pCondData) if (addedConds & (1 << i)) { g_addCondForward->PushCell(client); - g_addCondForward->PushCell(i); + g_addCondForward->PushCell(i + m_CondOffset[var]); g_addCondForward->Execute(NULL); } else if (removedConds & (1 << i)) { g_removeCondForward->PushCell(client); - g_removeCondForward->PushCell(i); + g_removeCondForward->PushCell(i + m_CondOffset[var]); g_removeCondForward->Execute(NULL); } } @@ -141,6 +138,12 @@ bool PlayerConditionsMgr::SetupProp(const char *varname) bool PlayerConditionsMgr::Init() { + m_CondOffset[m_nPlayerCond] = 0; + m_CondOffset[_condition_bits] = 0; + m_CondOffset[m_nPlayerCondEx] = 32; + m_CondOffset[m_nPlayerCondEx2] = 64; + m_CondOffset[m_nPlayerCondEx3] = 96; + memset(m_BackupProxyFns, 0, sizeof(m_BackupProxyFns)); bool bFoundProps = SetupProp("m_nPlayerCond") diff --git a/extensions/tf2/conditions.h b/extensions/tf2/conditions.h index f22e9982..51558aa2 100644 --- a/extensions/tf2/conditions.h +++ b/extensions/tf2/conditions.h @@ -73,6 +73,7 @@ private: private: int m_OldConds[SM_MAXPLAYERS + 1][CondVar_LastNotifyProp]; sm_sendprop_info_t m_CondVarProps[CondVar_Count]; + int m_CondOffset[CondVar_LastNotifyProp]; SendVarProxyFn m_BackupProxyFns[CondVar_LastNotifyProp]; };