mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-23 04:18:41 +00:00
Return for GetRawBotList
This checks offline bots too
This commit is contained in:
+7
-9
@@ -1017,11 +1017,9 @@ void Group::GetBotList(std::list<Bot*>& bot_list, bool clear_list)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Group::GetRawBotList(std::list<uint32>& bot_list, bool clear_list)
|
std::list<uint32> Group::GetRawBotList()
|
||||||
{
|
{
|
||||||
if (clear_list) {
|
std::list<uint32> bot_list;
|
||||||
bot_list.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto& l = GroupIdRepository::GetWhere(
|
const auto& l = GroupIdRepository::GetWhere(
|
||||||
database,
|
database,
|
||||||
@@ -1032,10 +1030,12 @@ void Group::GetRawBotList(std::list<uint32>& bot_list, bool clear_list)
|
|||||||
);
|
);
|
||||||
|
|
||||||
for (const auto& e : l) {
|
for (const auto& e : l) {
|
||||||
if (e.bot_id) {
|
if (e.bot_id) {
|
||||||
bot_list.push_back(e.bot_id);
|
bot_list.push_back(e.bot_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return bot_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Group::Process() {
|
bool Group::Process() {
|
||||||
@@ -1263,8 +1263,7 @@ void Client::LeaveGroup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (RuleB(Bots, Enabled)) {
|
if (RuleB(Bots, Enabled)) {
|
||||||
std::list<uint32> sbl;
|
std::list<uint32> sbl = g->GetRawBotList();
|
||||||
g->GetRawBotList(sbl);
|
|
||||||
|
|
||||||
for (auto botID : sbl) {
|
for (auto botID : sbl) {
|
||||||
auto b = entity_list.GetBotByBotID(botID);
|
auto b = entity_list.GetBotByBotID(botID);
|
||||||
@@ -2618,8 +2617,7 @@ void Group::AddToGroup(AddToGroupRequest r)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Group::RemoveClientsBots(Client* c) {
|
void Group::RemoveClientsBots(Client* c) {
|
||||||
std::list<uint32> sbl;
|
std::list<uint32> sbl = GetRawBotList();
|
||||||
GetRawBotList(sbl);
|
|
||||||
|
|
||||||
for (auto botID : sbl) {
|
for (auto botID : sbl) {
|
||||||
auto b = entity_list.GetBotByBotID(botID);
|
auto b = entity_list.GetBotByBotID(botID);
|
||||||
|
|||||||
+1
-1
@@ -69,7 +69,7 @@ public:
|
|||||||
void GetMemberList(std::list<Mob*>& member_list, bool clear_list = true);
|
void GetMemberList(std::list<Mob*>& member_list, bool clear_list = true);
|
||||||
void GetClientList(std::list<Client*>& client_list, bool clear_list = true);
|
void GetClientList(std::list<Client*>& client_list, bool clear_list = true);
|
||||||
void GetBotList(std::list<Bot*>& bot_list, bool clear_list = true);
|
void GetBotList(std::list<Bot*>& bot_list, bool clear_list = true);
|
||||||
void GetRawBotList(std::list<uint32>& bot_list, bool clear_list = true);
|
std::list<uint32> GetRawBotList();
|
||||||
bool IsGroupMember(Mob* c);
|
bool IsGroupMember(Mob* c);
|
||||||
bool IsGroupMember(const char* name);
|
bool IsGroupMember(const char* name);
|
||||||
bool Process();
|
bool Process();
|
||||||
|
|||||||
Reference in New Issue
Block a user