mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
feat(Core/Command): Use timestring with all commands (#12050)
This commit is contained in:
@@ -117,8 +117,33 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool HandleBattlefieldTimer(ChatHandler* handler, uint32 battleId, uint32 time)
|
||||
static bool HandleBattlefieldTimer(ChatHandler* handler, uint32 battleId, std::string timeStr)
|
||||
{
|
||||
if (timeStr.empty())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Acore::StringTo<int32>(timeStr).value_or(0) < 0)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 time = TimeStringToSecs(timeStr);
|
||||
if (time <= 0)
|
||||
{
|
||||
time = Acore::StringTo<int32>(timeStr).value_or(0);
|
||||
}
|
||||
|
||||
if (time <= 0)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
handler->SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(battleId);
|
||||
|
||||
if (!bf)
|
||||
|
||||
Reference in New Issue
Block a user