mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-18 08:18:27 +00:00
** Fix for groups with multiple players and bots.
* Fixes non-group leaders zoning with their bots. * Fixes non-bot owners attempting to load bots they don't own. * Sets bots that zone to follow owner not group leader. * Updates database call only load bots in group you own. * Tested on server 2 clients, 4 bots, all permutations of zoning.
This commit is contained in:
+6
-13
@@ -2459,9 +2459,10 @@ bool BotDatabase::LoadBotGroupsListByOwnerID(const uint32 owner_id, std::list<st
|
||||
|
||||
|
||||
/* Bot owner group functions */
|
||||
bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 group_id, std::list<uint32>& group_list)
|
||||
// added owner ID to this function to fix groups with mulitple players grouped with bots.
|
||||
bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 owner_id, const uint32 group_id, std::list<uint32>& group_list)
|
||||
{
|
||||
if (!group_id)
|
||||
if (!group_id || !owner_id)
|
||||
return false;
|
||||
|
||||
query = StringFormat(
|
||||
@@ -2471,18 +2472,10 @@ bool BotDatabase::LoadGroupedBotsByGroupID(const uint32 group_id, std::list<uint
|
||||
" AND `charid` IN ("
|
||||
" SELECT `bot_id`"
|
||||
" FROM `bot_data`"
|
||||
" WHERE `owner_id` IN ("
|
||||
" SELECT `charid`"
|
||||
" FROM `group_id`"
|
||||
" WHERE `groupid` = '%u'"
|
||||
" AND `name` IN ("
|
||||
" SELECT `name`"
|
||||
" FROM `character_data`"
|
||||
" )"
|
||||
" )"
|
||||
" )",
|
||||
" WHERE `owner_id` = '%u'"
|
||||
" )",
|
||||
group_id,
|
||||
group_id
|
||||
owner_id
|
||||
);
|
||||
|
||||
auto results = QueryDatabase(query);
|
||||
|
||||
Reference in New Issue
Block a user