Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix unused variable warning in GlobalMethods:Ban() #183

Merged
merged 5 commits into from
Jul 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading