feat(Core/Common): add new helpers for time utility (#10207)

This commit is contained in:
Kargatum
2022-01-19 12:01:59 +07:00
committed by GitHub
parent b5ab409614
commit 259b9133f6
60 changed files with 732 additions and 341 deletions

View File

@@ -532,11 +532,9 @@ struct npc_dark_iron_attack_generator : public ScriptedAI
bool AllowStart()
{
time_t curtime = time(nullptr);
tm strDate;
localtime_r(&curtime, &strDate);
auto minutes = Acore::Time::GetMinutes();
if (strDate.tm_min == 0 || strDate.tm_min == 30)
if (!minutes || minutes == 30)
return true;
return false;