mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Bug Fix] Check Rule "Bots Enabled" to prevent bot database calls on connect (#3154)
* [Bug Fix] Check for Rule "Bots Enabled" to prevent bot database calls if not enabled. * formatting * check if LoadBotsList failed, or is bots_list empty
This commit is contained in:
+2
-22
@@ -607,28 +607,8 @@ void Client::CompleteConnect()
|
||||
if (raid) {
|
||||
SetRaidGrouped(true);
|
||||
raid->LearnMembers();
|
||||
std::list<BotsAvailableList> bots_list;
|
||||
database.botdb.LoadBotsList(this->CharacterID(), bots_list);
|
||||
std::vector<RaidMember> r_members = raid->GetMembers();
|
||||
for (const RaidMember& iter : r_members) {
|
||||
if (iter.member_name) {
|
||||
for (const BotsAvailableList& b_iter : bots_list)
|
||||
{
|
||||
if (strcmp(iter.member_name, b_iter.Name) == 0)
|
||||
{
|
||||
char buffer[71] = "^spawn ";
|
||||
strcat(buffer, iter.member_name);
|
||||
bot_command_real_dispatch(this, buffer);
|
||||
Bot* b = entity_list.GetBotByBotName(iter.member_name);
|
||||
if (b)
|
||||
{
|
||||
b->SetRaidGrouped(true);
|
||||
b->p_raid_instance = raid;
|
||||
//b->SetFollowID(this->GetID());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (RuleB(Bots, Enabled)) {
|
||||
SpawnRaidBotsOnConnect(raid);
|
||||
}
|
||||
raid->VerifyRaid();
|
||||
raid->GetRaidDetails();
|
||||
|
||||
Reference in New Issue
Block a user