Merged changes from SH:List

Fixed bug where natives did not use the debugger (experimental)
Removed array size detection :(
This commit is contained in:
David Anderson
2006-01-06 14:37:58 +00:00
parent 0c745590ec
commit 3d00b8c545
4 changed files with 252 additions and 281 deletions

View File

@@ -31,6 +31,7 @@
#include "amxmodx.h"
#include "sh_stack.h"
#include "natives.h"
#include "Debugger.h"
#ifdef __linux__
#include <malloc.h>
@@ -87,18 +88,26 @@ int amxx_DynaCallback(int idx, AMX *amx, cell *params)
for (int i=numParams; i>=1; i--)
amx_Push(pNative->amx, params[i]);
}
if ( (err=amx_Exec(pNative->amx, &ret, pNative->func)) != AMX_ERR_NONE)
{
g_NativeStack.pop();
LogError(pNative->amx, err, "");
return 0;
}
if (g_errorNum)
Debugger *pDebugger = (Debugger *)amx->userdata[UD_DEBUGGER];
if (pDebugger)
pDebugger->BeginExec();
err=amx_Exec(pNative->amx, &ret, pNative->func);
if (err != AMX_ERR_NONE)
{
if (pDebugger && pDebugger->ErrorExists())
{
//don't care
} else if (err != -1) {
//nothing logged the error
LogError(amx, err, NULL);
}
amx->error = AMX_ERR_NONE;
} else if (g_errorNum) {
g_NativeStack.pop();
LogError(amx, g_errorNum, g_errorStr);
return ret;
}
if (pDebugger)
pDebugger->EndExec();
g_NativeStack.pop();
return ret;