From 116536fe36cdc5c50501f6b74409db9b4c2c1640 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 26 Sep 2005 22:11:44 +0000 Subject: [PATCH] Fix for bug 19453 (karlos) --- amxmodx/amxmodx.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index f4f75d27..e606fd88 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -32,6 +32,7 @@ #include #include "amxmodx.h" #include "natives.h" +#include "debugger.h" static cell AMX_NATIVE_CALL get_xvar_id(AMX *amx, cell *params) { @@ -3092,6 +3093,10 @@ static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params) // call the func cell retVal; int err; + Debugger *pDebugger = (Debugger *)amx->userdata[UD_DEBUGGER]; + + if (pDebugger) + pDebugger->BeginExec(); // copy the globs so the called func can also use callfunc cell gparams[CALLFUNC_MAXPARAMS]; @@ -3117,11 +3122,21 @@ static cell AMX_NATIVE_CALL callfunc_end(AMX *amx, cell *params) amx_Push(pAmx, gparams[i]); } - if ((err = amx_Exec(pAmx, &retVal, func) != AMX_ERR_NONE)) + err = amx_Exec(pAmx, &retVal, func); + + if (err != AMX_ERR_NONE) { - return 0; + if (pDebugger && pDebugger->ErrorExists()) + { + //already handled + } else { + LogError(amx, err, NULL); + } } + if (pDebugger) + pDebugger->EndExec(); + // process byref params (not byref_reused) for (int i = 0; i < curParam; ++i) {