Jump to content

[10404][Patch] Creature::CanAssistTo(), missing check


Guest Revils

Recommended Posts

  • * What bug does the patch fix? What features does the patch add?
    add a missing check to prevent mobs with AI to attack players despite some UNIT_FLAGS as answer to a "CallForHelp" from another mob
    * For which repository revision was the patch created?
    10403
    * Is there a thread in the bug report section or at lighthouse? If yes, please add a link to the thread.
    none
    * Who has been writing this patch? Please include either forum user names or email addresses.
    Revils

diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index ed675c4..c63a58b 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -1703,6 +1703,9 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
    if (isCivilian())
        return false;

+    if (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_PASSIVE))
+        return false;
+
    // skip fighting creature
    if (isInCombat())
        return false;

p.s.

I'm not sure if UNIT_STAT_STUNNED should be checked too

Link to comment
Share on other sites

×
×
  • 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