mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-08 15:58:04 +00:00
fix(Scripts/Commands): guild commands revert back to using guild names in quotes (#17798)
* initial * remove tabs
This commit is contained in:
@@ -67,6 +67,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guildName = guild_commandscript::_RemoveQuotes(guildName);
|
||||||
|
|
||||||
|
if (guildName.empty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Player* playerTarget = target->GetConnectedPlayer();
|
Player* playerTarget = target->GetConnectedPlayer();
|
||||||
|
|
||||||
if (playerTarget->GetGuildId())
|
if (playerTarget->GetGuildId())
|
||||||
@@ -106,6 +113,8 @@ public:
|
|||||||
|
|
||||||
static bool HandleGuildDeleteCommand(ChatHandler*, std::string_view guildName)
|
static bool HandleGuildDeleteCommand(ChatHandler*, std::string_view guildName)
|
||||||
{
|
{
|
||||||
|
guildName = guild_commandscript::_RemoveQuotes(guildName);
|
||||||
|
|
||||||
if (guildName.empty())
|
if (guildName.empty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@@ -133,6 +142,13 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
guildName = guild_commandscript::_RemoveQuotes(guildName);
|
||||||
|
|
||||||
|
if (guildName.empty())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Guild* targetGuild = sGuildMgr->GetGuildByName(guildName);
|
Guild* targetGuild = sGuildMgr->GetGuildByName(guildName);
|
||||||
if (!targetGuild)
|
if (!targetGuild)
|
||||||
return false;
|
return false;
|
||||||
@@ -188,12 +204,10 @@ public:
|
|||||||
|
|
||||||
static bool HandleGuildRenameCommand(ChatHandler* handler, std::string_view oldGuildStr, std::string_view newGuildStr)
|
static bool HandleGuildRenameCommand(ChatHandler* handler, std::string_view oldGuildStr, std::string_view newGuildStr)
|
||||||
{
|
{
|
||||||
if (!oldGuildStr.empty())
|
oldGuildStr = guild_commandscript::_RemoveQuotes(oldGuildStr);
|
||||||
{
|
newGuildStr = guild_commandscript::_RemoveQuotes(newGuildStr);
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newGuildStr.empty())
|
if (oldGuildStr.empty() || newGuildStr.empty())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -261,6 +275,20 @@ public:
|
|||||||
handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo().c_str()); // Extra Information
|
handler->PSendSysMessage(LANG_GUILD_INFO_EXTRA_INFO, guild->GetInfo().c_str()); // Extra Information
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
private:
|
||||||
|
static std::string_view _RemoveQuotes(std::string_view inputString)
|
||||||
|
{
|
||||||
|
if (inputString.starts_with('"') && inputString.ends_with('"'))
|
||||||
|
{
|
||||||
|
inputString.remove_prefix(1);
|
||||||
|
inputString.remove_suffix(1);
|
||||||
|
return inputString;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void AddSC_guild_commandscript()
|
void AddSC_guild_commandscript()
|
||||||
|
|||||||
Reference in New Issue
Block a user