From 8e4c7d7274c14ac6181fc3d9c6799d89a3606b96 Mon Sep 17 00:00:00 2001 From: Dr!fter Date: Thu, 13 Feb 2014 20:07:26 -0500 Subject: [PATCH] Remove the ability to set string_t return values. --- natives.cpp | 8 -------- vhook.h | 8 ++------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/natives.cpp b/natives.cpp index d6d8fc2..8b3ca0f 100644 --- a/natives.cpp +++ b/natives.cpp @@ -581,14 +581,6 @@ cell_t Native_SetReturnString(IPluginContext *pContext, const cell_t *params) switch(returnStruct->type) { - case ReturnType_String: - *(string_t *)returnStruct->newResult = MAKE_STRING(value); - returnStruct->isChanged = true; - return 1; - case ReturnType_StringPtr: - *(string_t **)returnStruct->newResult = new string_t(MAKE_STRING(value)); - returnStruct->isChanged = true; - return 1; case ReturnType_CharPtr: *(char **)returnStruct->newResult = new char[strlen(value)+1]; strcpy(*(char **)returnStruct->newResult, value); diff --git a/vhook.h b/vhook.h index e2860bc..5cad268 100644 --- a/vhook.h +++ b/vhook.h @@ -91,20 +91,16 @@ class HookReturnStruct public: ~HookReturnStruct() { - if(this->type != ReturnType_CharPtr && this->type != ReturnType_StringPtr && this->type != ReturnType_Vector && this->type != ReturnType_VectorPtr) + if(this->type != ReturnType_CharPtr && this->type != ReturnType_Vector && this->type != ReturnType_VectorPtr) { free(this->newResult); } else if(this->isChanged) { - if(this->type != ReturnType_CharPtr) + if(this->type == ReturnType_CharPtr) { delete *(char **)this->newResult; } - else if(this->type != ReturnType_StringPtr) - { - delete *(string_t **)this->newResult; - } else if(this->type == ReturnType_Vector || this->type == ReturnType_VectorPtr) { delete *(Vector **)this->newResult;