From b57367dd305901cb9e395964d38d3ec929db73bf Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 30 Mar 2006 20:42:11 +0000 Subject: [PATCH] abort() now cancels a callfunc --- amxmodx/amxmodx.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index e3c0d33a..8e4d6d03 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -3216,6 +3216,13 @@ static cell AMX_NATIVE_CALL callfunc_begin_i(AMX *amx, cell *params) if (!plugin) return -1; + if (g_CallFunc_Plugin) + { + // scripter's fault + LogError(amx, AMX_ERR_NATIVE, "callfunc_begin called without callfunc_end"); + return 0; + } + if (params[1] < 0) { LogError(amx, AMX_ERR_NATIVE, "Public function %d is invalid", params[1]); @@ -3697,6 +3704,10 @@ static cell AMX_NATIVE_CALL amx_abort(AMX *amx, cell *params) if (pPlugin) filename = pPlugin->getName(); + //we were in a callfunc? + if (g_CallFunc_Plugin == pPlugin) + g_CallFunc_Plugin = NULL; + if (fmt) LogError(amx, err, "[%s] %s", filename, fmt); else