From 5b806a467b4c203c4c00f5d70075364510b7afee Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Tue, 30 Nov 2010 13:09:30 -0500 Subject: [PATCH] Fixed BanClient always banning by IP address (bug 4626, r=fyren). --- core/logic/smn_banning.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/logic/smn_banning.cpp b/core/logic/smn_banning.cpp index 0230404e..3bfb1cdf 100644 --- a/core/logic/smn_banning.cpp +++ b/core/logic/smn_banning.cpp @@ -269,9 +269,14 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params) ban_flags = params[3]; ban_source = params[7]; -#if SOURCE_ENGINE != SE_DARKMESSIAH /* Check how we should ban the player */ - if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO) + if (!strcmp(smcore.GetSourceEngineName(), "darkmessiah")) + { + /* Dark Messiah doesn't have Steam IDs so there is only one ban method to choose */ + ban_flags |= BANFLAG_IP; + ban_flags &= ~BANFLAG_AUTHID; + } + else if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO) { if (gamehelpers->IsLANServer() || !pPlayer->IsAuthorized()) { @@ -305,11 +310,6 @@ static cell_t BanClient(IPluginContext *pContext, const cell_t *params) { return pContext->ThrowNativeError("No valid ban method flags specified"); } -#else - /* Dark Messiah doesn't have Steam IDs so there is only one ban method to choose */ - ban_flags |= BANFLAG_IP; - ban_flags &= ~BANFLAG_AUTHID; -#endif cell_t handled = 0; if (ban_cmd[0] != '\0' && g_pOnBanClient->GetFunctionCount() > 0)