Fix passing incorrect cond# to forwards for CondEx/2/3 fields.
This commit is contained in:
parent
c4a58b1c95
commit
ac530a4ce0
@ -31,9 +31,6 @@
|
|||||||
|
|
||||||
#include "extension.h"
|
#include "extension.h"
|
||||||
#include "conditions.h"
|
#include "conditions.h"
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
#include <iplayerinfo.h>
|
|
||||||
|
|
||||||
IForward *g_addCondForward = NULL;
|
IForward *g_addCondForward = NULL;
|
||||||
IForward *g_removeCondForward = NULL;
|
IForward *g_removeCondForward = NULL;
|
||||||
@ -87,13 +84,13 @@ void PlayerConditionsMgr::ProcessCondChange(CondChangeData_t *pCondData)
|
|||||||
if (addedConds & (1 << i))
|
if (addedConds & (1 << i))
|
||||||
{
|
{
|
||||||
g_addCondForward->PushCell(client);
|
g_addCondForward->PushCell(client);
|
||||||
g_addCondForward->PushCell(i);
|
g_addCondForward->PushCell(i + m_CondOffset[var]);
|
||||||
g_addCondForward->Execute(NULL);
|
g_addCondForward->Execute(NULL);
|
||||||
}
|
}
|
||||||
else if (removedConds & (1 << i))
|
else if (removedConds & (1 << i))
|
||||||
{
|
{
|
||||||
g_removeCondForward->PushCell(client);
|
g_removeCondForward->PushCell(client);
|
||||||
g_removeCondForward->PushCell(i);
|
g_removeCondForward->PushCell(i + m_CondOffset[var]);
|
||||||
g_removeCondForward->Execute(NULL);
|
g_removeCondForward->Execute(NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -141,6 +138,12 @@ bool PlayerConditionsMgr::SetupProp(const char *varname)
|
|||||||
|
|
||||||
bool PlayerConditionsMgr::Init()
|
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));
|
memset(m_BackupProxyFns, 0, sizeof(m_BackupProxyFns));
|
||||||
|
|
||||||
bool bFoundProps = SetupProp<m_nPlayerCond>("m_nPlayerCond")
|
bool bFoundProps = SetupProp<m_nPlayerCond>("m_nPlayerCond")
|
||||||
|
@ -73,6 +73,7 @@ private:
|
|||||||
private:
|
private:
|
||||||
int m_OldConds[SM_MAXPLAYERS + 1][CondVar_LastNotifyProp];
|
int m_OldConds[SM_MAXPLAYERS + 1][CondVar_LastNotifyProp];
|
||||||
sm_sendprop_info_t m_CondVarProps[CondVar_Count];
|
sm_sendprop_info_t m_CondVarProps[CondVar_Count];
|
||||||
|
int m_CondOffset[CondVar_LastNotifyProp];
|
||||||
SendVarProxyFn m_BackupProxyFns[CondVar_LastNotifyProp];
|
SendVarProxyFn m_BackupProxyFns[CondVar_LastNotifyProp];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user