Execute result pointer is now optional
fixed a bug where result could be filled with no executions --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40453
This commit is contained in:
parent
06fa51700f
commit
085264e837
@ -391,15 +391,20 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_ExecType == ET_Event || m_ExecType == ET_Hook)
|
if (success)
|
||||||
{
|
{
|
||||||
cur_result = high_result;
|
if (m_ExecType == ET_Event || m_ExecType == ET_Hook)
|
||||||
} else if (m_ExecType == ET_Ignore) {
|
{
|
||||||
cur_result = 0;
|
cur_result = high_result;
|
||||||
|
} else if (m_ExecType == ET_Ignore) {
|
||||||
|
cur_result = 0;
|
||||||
|
}
|
||||||
|
if (result)
|
||||||
|
{
|
||||||
|
*result = cur_result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*result = cur_result;
|
|
||||||
|
|
||||||
if (filter)
|
if (filter)
|
||||||
{
|
{
|
||||||
filter->OnExecuteEnd(&cur_result, success, failed);
|
filter->OnExecuteEnd(&cur_result, success, failed);
|
||||||
|
@ -165,7 +165,7 @@ namespace SourceMod
|
|||||||
/**
|
/**
|
||||||
* @brief Executes the forward.
|
* @brief Executes the forward.
|
||||||
*
|
*
|
||||||
* @param result Pointer to store result in.
|
* @param result Optional pointer to store result in.
|
||||||
* @param filter Optional pointer to an IForwardFilter.
|
* @param filter Optional pointer to an IForwardFilter.
|
||||||
* @return Error code, if any.
|
* @return Error code, if any.
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user