core/smn_fakenatives.cpp
changeset 2193 db7c6362f3f2
parent 2086 debb2ab2c782
child 2289 44045ead61cd
     1.1 --- a/core/smn_fakenatives.cpp	Thu Jul 10 01:26:02 2008 +0000
     1.2 +++ b/core/smn_fakenatives.cpp	Fri Jul 11 08:18:43 2008 +0000
     1.3 @@ -54,8 +54,7 @@
     1.4  	}
     1.5  
     1.6  	/* Check if the native is paused */
     1.7 -	sp_context_t *pNativeCtx = native->ctx->GetContext();
     1.8 -	if ((pNativeCtx->flags & SPFLAG_PLUGIN_PAUSED) == SPFLAG_PLUGIN_PAUSED)
     1.9 +	if (native->ctx->GetRuntime()->IsPaused())
    1.10  	{
    1.11  		return pContext->ThrowNativeError("Plugin owning this native is currently paused.");
    1.12  	}
    1.13 @@ -90,7 +89,7 @@
    1.14  	int error;
    1.15  	if ((error=native->call->Execute(&result)) != SP_ERROR_NONE)
    1.16  	{
    1.17 -		if (pContext->GetContext()->n_err == SP_ERROR_NONE)
    1.18 +		if (pContext->GetLastNativeError() == SP_ERROR_NONE)
    1.19  		{
    1.20  			pContext->ThrowNativeErrorEx(error, "Error encountered while processing a dynamic native");
    1.21  		}
    1.22 @@ -146,7 +145,7 @@
    1.23  
    1.24  	g_SourceMod.FormatString(buffer, sizeof(buffer), pContext, params, 2);
    1.25  
    1.26 -	if (pContext->GetContext()->n_err != SP_ERROR_NONE)
    1.27 +	if (pContext->GetLastNativeError() != SP_ERROR_NONE)
    1.28  	{
    1.29  		s_curcaller->ThrowNativeError("Error encountered while processing a dynamic native");
    1.30  	} else {
    1.31 @@ -434,7 +433,7 @@
    1.32  	pContext->LocalToPhysAddr(params[5], &addr);
    1.33  	*addr = (cell_t)written;
    1.34  
    1.35 -	return s_curcaller->GetContext()->n_err;
    1.36 +	return s_curcaller->GetLastNativeError();
    1.37  }
    1.38  
    1.39  //tee hee