Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 14th, 2012  |  syntax: None  |  size: 0.85 KB  |  hits: 13  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
  2. index 94949e8..ea91a68 100644
  3. --- a/src/game/Unit.cpp
  4. +++ b/src/game/Unit.cpp
  5. @@ -7957,6 +7957,12 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
  6.      if (!pVictim || pdamage == 0 || (spellProto && spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS))
  7.          return pdamage;
  8.  
  9. +    if (!pVictim->IsInWorld() || !pVictim->GetMap() || !GetMap())
  10. +        return pdamage;
  11. +
  12. +    MAPLOCK_READ(this,MAP_LOCK_TYPE_AURAS);
  13. +    MAPLOCK_READ1(pVictim,MAP_LOCK_TYPE_AURAS);
  14. +
  15.      // differentiate for weapon damage based spells
  16.      bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE)));
  17.      Item*  pWeapon          = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType,true,false) : NULL;