From d3a4c972e27bb9312ad7d1e7b956b083e0cef3cb Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Sat, 15 Nov 2014 11:31:18 -0500 Subject: [PATCH] Add static_assert on ConBitVecAndNot hack so it gets updated on next cond count change. --- extensions/tf2/conditions.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/tf2/conditions.cpp b/extensions/tf2/conditions.cpp index 9bad0641..ea8d7514 100644 --- a/extensions/tf2/conditions.cpp +++ b/extensions/tf2/conditions.cpp @@ -37,7 +37,9 @@ #include -typedef CBitVec<128> condbitvec_t; +const int TF_MAX_CONDITIONS = 128; + +typedef CBitVec condbitvec_t; condbitvec_t g_PlayerActiveConds[SM_MAXPLAYERS + 1]; IForward *g_addCondForward = NULL; @@ -68,6 +70,8 @@ inline void GetPlayerConds(CBaseEntity *pPlayer, condbitvec_t *pOut) inline void CondBitVecAndNot(const condbitvec_t &src, const condbitvec_t &addStr, condbitvec_t *out) { + static_assert(TF_MAX_CONDITIONS == 128, "CondBitVecAndNot hack is hardcoded for 128-bit bitvec."); + // CBitVec has And and Not, but not a simple, combined AndNot. // We'll also treat the halves as two 64-bit ints instead of four 32-bit ints // as a minor optimization (maybe?) that the compiler is not making itself.