diff --git a/core/smn_core.cpp b/core/smn_core.cpp index b19900d8..4d301db4 100644 --- a/core/smn_core.cpp +++ b/core/smn_core.cpp @@ -682,11 +682,11 @@ static cell_t LoadFromAddress(IPluginContext *pContext, const cell_t *params) if (addr == NULL) { - pContext->ThrowNativeError("Address cannot be null"); + return pContext->ThrowNativeError("Address cannot be null"); } else if (reinterpret_cast(addr) < VALID_MINIMUM_MEMORY_ADDRESS) { - pContext->ThrowNativeError("Invalid address 0x%x is pointing to reserved memory.", addr); + return pContext->ThrowNativeError("Invalid address 0x%x is pointing to reserved memory.", addr); } NumberType size = static_cast(params[2]); @@ -699,10 +699,8 @@ static cell_t LoadFromAddress(IPluginContext *pContext, const cell_t *params) case NumberType_Int32: return *reinterpret_cast(addr); default: - pContext->ThrowNativeError("Invalid number types %d", size); + return pContext->ThrowNativeError("Invalid number types %d", size); } - - return 1; } @@ -712,11 +710,11 @@ static cell_t StoreToAddress(IPluginContext *pContext, const cell_t *params) if (addr == NULL) { - pContext->ThrowNativeError("Address cannot be null"); + return pContext->ThrowNativeError("Address cannot be null"); } else if (reinterpret_cast(addr) < VALID_MINIMUM_MEMORY_ADDRESS) { - pContext->ThrowNativeError("Invalid address 0x%x is pointing to reserved memory.", addr); + return pContext->ThrowNativeError("Invalid address 0x%x is pointing to reserved memory.", addr); } cell_t data = params[2]; @@ -737,10 +735,10 @@ static cell_t StoreToAddress(IPluginContext *pContext, const cell_t *params) *reinterpret_cast(addr) = data; break; default: - pContext->ThrowNativeError("Invalid number types %d", size); + return pContext->ThrowNativeError("Invalid number types %d", size); } - return 1; + return 0; } REGISTER_NATIVES(coreNatives)