From 3171e6fc5bbecf6c974b5611948d507c340958f8 Mon Sep 17 00:00:00 2001 From: KyleSanderson Date: Thu, 6 Feb 2014 18:54:37 -0700 Subject: [PATCH] We can't break Logins entirely here; if they don't have a plugin at the start... just no. --- Extension/swgshooks.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Extension/swgshooks.cpp b/Extension/swgshooks.cpp index 4e406d7..8bd100e 100644 --- a/Extension/swgshooks.cpp +++ b/Extension/swgshooks.cpp @@ -60,16 +60,17 @@ void SteamWorksGSHooks::LogOnAnonymous(void) RETURN_META(MRES_SUPERCEDE); } + if (this->pFOTR->GetFunctionCount() == 0) + { + /* No plugin was loaded to handle this. Anon away; we can't break them. */ + RETURN_META(MRES_IGNORED); + } + char pToken[256]; pToken[0] = '\0'; - - if (this->pFOTR->GetFunctionCount() != 0) - { - cell_t result = Pl_Continue; - this->pFOTR->PushStringEx(pToken, sizeof(pToken), SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK); - this->pFOTR->PushCell(sizeof(pToken)); - this->pFOTR->Execute(&result); - } + this->pFOTR->PushStringEx(pToken, sizeof(pToken), SM_PARAM_STRING_UTF8 | SM_PARAM_STRING_COPY, SM_PARAM_COPYBACK); + this->pFOTR->PushCell(sizeof(pToken)); + this->pFOTR->Execute(NULL); pGameServer->LogOn(pToken, pToken); RETURN_META(MRES_SUPERCEDE);