Skip to content

Commit

Permalink
Activity: Bots inside battlegrounds are no longer allowed to be inact…
Browse files Browse the repository at this point in the history
…ive when the server is under high load.
  • Loading branch information
mostlikely4r committed Feb 21, 2025
1 parent a20b74f commit 55d0330
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
8 changes: 6 additions & 2 deletions playerbot/PlayerbotAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5684,8 +5684,11 @@ ActivePiorityType PlayerbotAI::GetPriorityType()
}
}

if (bot->IsBeingTeleported()) //Allow activity while teleportation.
return ActivePiorityType::IN_INSTANCE;
if (bot->IsBeingTeleported()) //We might end up in a bg so stay active.
return ActivePiorityType::IN_BATTLEGROUND;

if (!WorldPosition(bot).isBg())

This comment has been minimized.

Copy link
@Exxenoz

Exxenoz Feb 21, 2025

Member

The ! must be removed.

return ActivePiorityType::IN_BATTLEGROUND;

if (!WorldPosition(bot).isOverworld())
return ActivePiorityType::IN_INSTANCE;
Expand Down Expand Up @@ -5762,6 +5765,7 @@ std::pair<uint32, uint32> PlayerbotAI::GetPriorityBracket(ActivePiorityType type
case ActivePiorityType::IS_REAL_PLAYER:
case ActivePiorityType::IN_GROUP_WITH_REAL_PLAYER:
case ActivePiorityType::VISIBLE_FOR_PLAYER:
case ActivePiorityType::IN_BATTLEGROUND:
return { 0,0 };
case ActivePiorityType::IN_INSTANCE:
return { 0,5 };
Expand Down
29 changes: 15 additions & 14 deletions playerbot/PlayerbotAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,20 +277,21 @@ enum class ActivePiorityType : uint8
{
IS_REAL_PLAYER = 0,
HAS_REAL_PLAYER_MASTER = 1,
IN_GROUP_WITH_REAL_PLAYER = 2,
IN_INSTANCE = 3,
VISIBLE_FOR_PLAYER = 4,
IS_ALWAYS_ACTIVE = 5,
IN_COMBAT = 6,
IN_BG_QUEUE = 7,
IN_LFG = 8,
NEARBY_PLAYER = 9,
PLAYER_FRIEND = 10,
PLAYER_GUILD = 11,
IN_ACTIVE_AREA = 12,
IN_ACTIVE_MAP = 13,
IN_INACTIVE_MAP = 14,
IN_EMPTY_SERVER = 15,
IN_GROUP_WITH_REAL_PLAYER,
IN_BATTLEGROUND,
IN_INSTANCE,
VISIBLE_FOR_PLAYER,
IS_ALWAYS_ACTIVE,
IN_COMBAT,
IN_BG_QUEUE,
IN_LFG,
NEARBY_PLAYER,
PLAYER_FRIEND,
PLAYER_GUILD,
IN_ACTIVE_AREA,
IN_ACTIVE_MAP,
IN_INACTIVE_MAP,
IN_EMPTY_SERVER,
MAX_TYPE
};

Expand Down

0 comments on commit 55d0330

Please sign in to comment.