Skip to content

Commit

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

BanMode mode = BanMode::BAN_ACCOUNT;

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

BanReturn result;
#ifndef AZEROTHCORE
result = eWorld->BanAccount(mode, nameOrIP, duration, reason, whoBanned);
#else
switch (banMode)
{
case BAN_ACCOUNT:
Expand All @@ -2203,7 +2195,6 @@ namespace LuaGlobalFunctions
result = sBan->BanIP(nameOrIP, std::to_string(duration) + "s", reason, whoBanned);
break;
}
#endif

switch (result)
{
Expand Down

0 comments on commit b39869a

Please sign in to comment.