mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-03-15 05:25:08 +00:00
fix(Core/Commands): Achievement checkall (#12649)
This commit is contained in:
@@ -40,7 +40,7 @@ public:
|
|||||||
static ChatCommandTable achievementCommandTable =
|
static ChatCommandTable achievementCommandTable =
|
||||||
{
|
{
|
||||||
{ "add", HandleAchievementAddCommand, SEC_GAMEMASTER, Console::No },
|
{ "add", HandleAchievementAddCommand, SEC_GAMEMASTER, Console::No },
|
||||||
{ "checkall", HandleAchievementCheckAllCommand, SEC_ADMINISTRATOR, Console::No }
|
{ "checkall", HandleAchievementCheckAllCommand, SEC_ADMINISTRATOR, Console::Yes }
|
||||||
};
|
};
|
||||||
static ChatCommandTable commandTable =
|
static ChatCommandTable commandTable =
|
||||||
{
|
{
|
||||||
@@ -63,17 +63,33 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool HandleAchievementCheckAllCommand(ChatHandler* handler)
|
static bool HandleAchievementCheckAllCommand(ChatHandler* handler, Optional<PlayerIdentifier> player)
|
||||||
{
|
{
|
||||||
Player* target = handler->getSelectedPlayer();
|
if (!player)
|
||||||
if (!target)
|
|
||||||
{
|
{
|
||||||
handler->SendSysMessage(LANG_NO_CHAR_SELECTED);
|
player = PlayerIdentifier::FromTarget(handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!player)
|
||||||
|
{
|
||||||
|
handler->SendSysMessage(LANG_PLAYER_NOT_FOUND);
|
||||||
handler->SetSentErrorMessage(true);
|
handler->SetSentErrorMessage(true);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
target->CheckAllAchievementCriteria();
|
if (player->IsConnected())
|
||||||
|
{
|
||||||
|
if (Player* target = player->GetConnectedPlayer())
|
||||||
|
target->CheckAllAchievementCriteria();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
auto* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_ADD_AT_LOGIN_FLAG);
|
||||||
|
stmt->SetData(0, uint16(AT_LOGIN_CHECK_ACHIEVS));
|
||||||
|
stmt->SetData(1, player->GetGUID().GetCounter());
|
||||||
|
CharacterDatabase.Execute(stmt);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user