Playerbot: skip grouped bots for ALL kill/NPC-click credit (fix double count)
The core's party-share credits every grouped bot for BOTH combat kills AND NPC-click objectives (Fear No Evil click fires OnKillCredit for each grouped bot once, guid empty or not). The empty-guid special case pushed to all bots and double-counted. Simplify: skip grouped bots unconditionally (the core handles them); only ungrouped owned bots need the module push.
This commit is contained in:
@@ -3225,18 +3225,13 @@ void Module::OnKillCredit(Player* player, uint32 entry, ObjectGuid guid)
|
||||
if (bot->GetMapId() != player->GetMapId())
|
||||
continue;
|
||||
|
||||
// A real combat kill carries a creature guid and is ALREADY shared to
|
||||
// grouped bots by the core's party system — pushing again double-
|
||||
// counts the objective. So for combat kills (guid non-empty) skip
|
||||
// grouped bots; the core handles them, and only ungrouped bots need
|
||||
// the module push.
|
||||
//
|
||||
// An NPC-click credit (e.g. quest 63447 "Fear No Evil" — clicking
|
||||
// Injured Stormwind Infantry via a spell script) passes guid EMPTY
|
||||
// (0000000000000000): it is single-caster and NOT reliably shared to
|
||||
// party members (range/phase dependent). For those, push to ALL owned
|
||||
// in-world bots regardless of group so nobody misses a click.
|
||||
if (!guid.IsEmpty() && og && og->IsMember(bot->GetGUID()))
|
||||
// Grouped bots are ALREADY credited by the core's party-share for BOTH
|
||||
// combat kills (valid creature guid) and NPC-click credits (empty guid,
|
||||
// e.g. Fear No Evil) — observed: clicking Injured Stormwind Infantry
|
||||
// fires OnKillCredit for every grouped bot once. Pushing again to a
|
||||
// grouped bot double-counts the objective. Only bots NOT in the
|
||||
// owner's group need the module push.
|
||||
if (og && og->IsMember(bot->GetGUID()))
|
||||
continue;
|
||||
|
||||
bot->KilledMonsterCredit(entry, guid);
|
||||
|
||||
Reference in New Issue
Block a user