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:
David Anderson 2007-02-07 08:42:48 +00:00
parent 06fa51700f
commit 085264e837
2 changed files with 12 additions and 7 deletions

View File

@ -391,14 +391,19 @@ int CForward::Execute(cell_t *result, IForwardFilter *filter)
} }
} }
if (success)
{
if (m_ExecType == ET_Event || m_ExecType == ET_Hook) if (m_ExecType == ET_Event || m_ExecType == ET_Hook)
{ {
cur_result = high_result; cur_result = high_result;
} else if (m_ExecType == ET_Ignore) { } else if (m_ExecType == ET_Ignore) {
cur_result = 0; cur_result = 0;
} }
if (result)
{
*result = cur_result; *result = cur_result;
}
}
if (filter) if (filter)
{ {

View File

@ -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.
*/ */