Fixed BanClient always banning by IP address (bug 4626, r=fyren).
Fixed BanClient always banning by IP address (
bug 4626, r=fyren).
1.1 --- a/core/logic/smn_banning.cpp Tue Nov 30 13:08:30 2010 -0500
1.2 +++ b/core/logic/smn_banning.cpp Tue Nov 30 13:09:30 2010 -0500
1.3 @@ -269,9 +269,14 @@
1.4 ban_flags = params[3];
1.5 ban_source = params[7];
1.6
1.7 -#if SOURCE_ENGINE != SE_DARKMESSIAH
1.8 /* Check how we should ban the player */
1.9 - if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO)
1.10 + if (!strcmp(smcore.GetSourceEngineName(), "darkmessiah"))
1.11 + {
1.12 + /* Dark Messiah doesn't have Steam IDs so there is only one ban method to choose */
1.13 + ban_flags |= BANFLAG_IP;
1.14 + ban_flags &= ~BANFLAG_AUTHID;
1.15 + }
1.16 + else if ((ban_flags & BANFLAG_AUTO) == BANFLAG_AUTO)
1.17 {
1.18 if (gamehelpers->IsLANServer() || !pPlayer->IsAuthorized())
1.19 {
1.20 @@ -305,11 +310,6 @@
1.21 {
1.22 return pContext->ThrowNativeError("No valid ban method flags specified");
1.23 }
1.24 -#else
1.25 - /* Dark Messiah doesn't have Steam IDs so there is only one ban method to choose */
1.26 - ban_flags |= BANFLAG_IP;
1.27 - ban_flags &= ~BANFLAG_AUTHID;
1.28 -#endif
1.29
1.30 cell_t handled = 0;
1.31 if (ban_cmd[0] != '\0' && g_pOnBanClient->GetFunctionCount() > 0)