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?


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




Who has been writing this 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 )

+    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...
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