Jump to content

Recommended Posts

Posted

What bug does the patch fix? What features does the patch add?

Adds an additional check, that SetInCombatWithZone is only called, if the atter is a player or controlled by a player

This prevents possible bugs in case aggroing other NPCs

For which repository revision was the patch created?

11064

Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.

no

Who has been writing this patch? Please include either forum user names or email addresses.

me

Original Idea by NoFantasy.

Example where this makes a difference: Ragnaros Kills Majordomo with 19773 which triggers 'aggro' for both, and would with current design set ragnaros into combat with zone (which would be wrong)

Remark, not entirely sure if enemy can be NULL but this way it is safe

diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index c56fee8..68a9135 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7716,7 +7716,7 @@ void Unit::SetInCombatState(bool PvP, Unit* enemy)
            pCreature->AI()->EnterCombat(enemy);

        // Some bosses are set into combat with zone
-        if (GetMap()->IsDungeon() && (pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_AGGRO_ZONE))
+        if (GetMap()->IsDungeon() && (pCreature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_AGGRO_ZONE) && enemy && enemy->IsControlledByPlayer())
            pCreature->SetInCombatWithZone();

        if (InstanceData* mapInstance = GetInstanceData())

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use