Jump to content

[FIX] Set NPC PvP flag from DB field unit_flags


Auntie Mangos

Recommended Posts

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

This patch simply sets NPC PvP flag from DB field unit_flags with UNIT_FLAG_PVP/UNIT_FLAG_PVP_ATTACKABLE.

For which repository revision was the patch created?

7928

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

http://getmangos.eu/community/viewtopic.php?id=7021

http://udbforums.org/index.php?topic=12424.0

http://udbforums.org/index.php?topic=12822.0

Who has been writing this patch?

me.

patch:

diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp
index 24e4f8d..29f80a5 100644
--- a/src/game/Creature.cpp
+++ b/src/game/Creature.cpp
@@ -300,6 +300,9 @@ bool Creature::UpdateEntry(uint32 Entry, uint32 team, const CreatureData *data )
                SetPvP(true);
    }

+    if (GetCreatureInfo()->unit_flags & UNIT_FLAG_PVP || GetCreatureInfo()->unit_flags & UNIT_FLAG_PVP_ATTACKABLE)
+        SetPvP(true);
+
    for(int i=0; i < CREATURE_MAX_SPELLS; ++i)
        m_spells[i] = GetCreatureInfo()->spells[i];

Link to comment
Share on other sites

  • 40 years later...
Guest
This topic is now closed to further replies.
×
×
  • 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