core merge fixes for playerbots

This commit is contained in:
bash
2025-10-19 23:55:38 +02:00
parent 1aac4fbef6
commit fac127718d
8 changed files with 42 additions and 15 deletions

View File

@@ -97,6 +97,32 @@ public:
return _eventMap.empty();
}
/**
* @return Current internal time as uint32 milliseconds
*
* was removed in core https://github.com/azerothcore/azerothcore-wotlk/pull/23121,
* but still required atm for mod-playerbot.
*/
uint32 GetTimer() const
{
return static_cast<uint32>(duration_cast<Milliseconds>(_time.time_since_epoch()).count());
}
/**
* @return Time of found even
*
* was removed in core https://github.com/azerothcore/azerothcore-wotlk/pull/23121,
* but still required atm for mod-playerbot.
*/
uint32 GetNextEventTime(uint16 eventId) const
{
auto timeUntil = GetTimeUntilEvent(eventId);
if (timeUntil == Milliseconds::max())
return 0;
return GetTimer() + static_cast<uint32>(timeUntil.count());
}
/**
* @name SetPhase
* @brief Sets the phase of the map (absolute).