From 08ae7bea865b0c181f704d2369ecce18255c299d Mon Sep 17 00:00:00 2001 From: Kyle Date: Fri, 22 Jan 2021 19:31:38 +0800 Subject: [PATCH] Don't report if client disconnected --- extension.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/extension.cpp b/extension.cpp index 40c8a84..4465433 100644 --- a/extension.cpp +++ b/extension.cpp @@ -292,7 +292,13 @@ static cell_t Native_SetEntityOwner(IPluginContext* pContext, const cell_t* para g_Hooked[params[1]]->SetOwner(params[2]); return true; } - + + if (params[1] >= 1 && params[1] < SM_MAXPLAYERS) + { + smutils->LogError("Entity %d is not being hook.") + return false; + } + return pContext->ThrowNativeError("Entity %d is not being hook.", params[1]); } @@ -316,6 +322,12 @@ static cell_t Native_SetEntityState(IPluginContext* pContext, const cell_t* para return true; } + if (params[1] >= 1 && params[1] < SM_MAXPLAYERS) + { + smutils->LogError("Entity %d is not being hook.") + return false; + } + return pContext->ThrowNativeError("Entity %d is not being hook.", params[1]); }