mirror of
https://github.com/mod-playerbots/mod-playerbots
synced 2025-11-29 15:58:20 +08:00
Update RaidUlduarBossHelper.cpp
This commit is contained in:
@@ -133,24 +133,8 @@ bool RazorscaleBossHelper::AreRolesAssigned() const
|
|||||||
|
|
||||||
bool RazorscaleBossHelper::CanSwapRoles() const
|
bool RazorscaleBossHelper::CanSwapRoles() const
|
||||||
{
|
{
|
||||||
// Identify the GUID of the current bot
|
|
||||||
ObjectGuid botGuid = bot->GetGUID();
|
|
||||||
if (!botGuid)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// If no entry exists yet for this bot, initialize it to 0
|
|
||||||
auto it = _lastRoleSwapTime.find(botGuid);
|
|
||||||
if (it == _lastRoleSwapTime.end())
|
|
||||||
{
|
|
||||||
_lastRoleSwapTime[botGuid] = 0;
|
|
||||||
it = _lastRoleSwapTime.find(botGuid);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Compare the current time against the stored time
|
|
||||||
std::time_t currentTime = std::time(nullptr);
|
std::time_t currentTime = std::time(nullptr);
|
||||||
std::time_t lastSwapTime = it->second;
|
return (currentTime - _lastRoleSwapTime) >= _roleSwapCooldown;
|
||||||
|
|
||||||
return (currentTime - lastSwapTime) >= _roleSwapCooldown;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RazorscaleBossHelper::AssignRolesBasedOnHealth()
|
void RazorscaleBossHelper::AssignRolesBasedOnHealth()
|
||||||
|
|||||||
Reference in New Issue
Block a user