Skip to content

Commit

Permalink
handle unused variable in Ban() correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
sudlud committed Jul 4, 2024
1 parent e00386f commit 2378298
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/LuaEngine/GlobalMethods.h
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,9 @@ namespace LuaGlobalFunctions
const int BAN_CHARACTER = 1;
const int BAN_IP = 2;

#ifndef AZEROTHCORE
BanMode mode = BanMode::BAN_ACCOUNT;
#endif

switch (banMode)
{
Expand All @@ -2171,17 +2173,23 @@ namespace LuaGlobalFunctions
if (!AccountMgr::normalizeString(nameOrIP))
return luaL_argerror(L, 2, "invalid account name");
#endif
#ifndef AZEROTHCORE
mode = BanMode::BAN_ACCOUNT;
#endif
break;
case BAN_CHARACTER:
if (!normalizePlayerName(nameOrIP))
return luaL_argerror(L, 2, "invalid character name");
#ifndef AZEROTHCORE
mode = BanMode::BAN_CHARACTER;
#endif
break;
case BAN_IP:
if (!IsIPAddress(nameOrIP.c_str()))
return luaL_argerror(L, 2, "invalid ip");
#ifndef AZEROTHCORE
mode = BanMode::BAN_IP;
#endif
break;
default:
return luaL_argerror(L, 1, "unknown banmode");
Expand Down

0 comments on commit 2378298

Please sign in to comment.