From 8807939a14b12d5a66bc1bba3c56369af640ab84 Mon Sep 17 00:00:00 2001 From: JRiipinen Date: Fri, 27 Oct 2017 14:02:38 +0300 Subject: [PATCH] Update TF2_IsPlayerInCondition (#712) * Update TF2_IsPlayerInCondition * Update conditions too --- extensions/tf2/conditions.cpp | 4 +++- extensions/tf2/conditions.h | 1 + plugins/include/tf2_stocks.inc | 8 ++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/extensions/tf2/conditions.cpp b/extensions/tf2/conditions.cpp index 225df413..d7b74e5c 100644 --- a/extensions/tf2/conditions.cpp +++ b/extensions/tf2/conditions.cpp @@ -143,6 +143,7 @@ PlayerConditionsMgr::PlayerConditionsMgr() m_CondOffset[m_nPlayerCondEx] = 32; m_CondOffset[m_nPlayerCondEx2] = 64; m_CondOffset[m_nPlayerCondEx3] = 96; + m_CondOffset[m_nPlayerCondEx4] = 128; } bool PlayerConditionsMgr::Init() @@ -153,7 +154,8 @@ bool PlayerConditionsMgr::Init() && SetupProp<_condition_bits>("_condition_bits") && SetupProp("m_nPlayerCondEx") && SetupProp("m_nPlayerCondEx2") - && SetupProp("m_nPlayerCondEx3"); + && SetupProp("m_nPlayerCondEx3") + && SetupProp("m_nPlayerCondEx4"); if (!bFoundProps) return false; diff --git a/extensions/tf2/conditions.h b/extensions/tf2/conditions.h index 4aa76091..24404509 100644 --- a/extensions/tf2/conditions.h +++ b/extensions/tf2/conditions.h @@ -52,6 +52,7 @@ public: m_nPlayerCondEx, m_nPlayerCondEx2, m_nPlayerCondEx3, + m_nPlayerCondEx4, CondVar_Count }; diff --git a/plugins/include/tf2_stocks.inc b/plugins/include/tf2_stocks.inc index 9830f696..6b7ae20b 100644 --- a/plugins/include/tf2_stocks.inc +++ b/plugins/include/tf2_stocks.inc @@ -581,6 +581,14 @@ stock bool TF2_IsPlayerInCondition(int client, TFCond cond) return true; } } + case 4: + { + int bit = (1 << (iCond - 128)); + if ((GetEntProp(client, Prop_Send, "m_nPlayerCondEx4") & bit) == bit) + { + return true; + } + } default: ThrowError("Invalid TFCond value %d", iCond); }