
Untitled
By: a guest on
May 14th, 2012 | syntax:
None | size: 0.85 KB | hits: 13 | expires: Never
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index 94949e8..ea91a68 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -7957,6 +7957,12 @@ uint32 Unit::MeleeDamageBonusDone(Unit *pVictim, uint32 pdamage,WeaponAttackType
if (!pVictim || pdamage == 0 || (spellProto && spellProto->AttributesEx6 & SPELL_ATTR_EX6_NO_DMG_MODS))
return pdamage;
+ if (!pVictim->IsInWorld() || !pVictim->GetMap() || !GetMap())
+ return pdamage;
+
+ MAPLOCK_READ(this,MAP_LOCK_TYPE_AURAS);
+ MAPLOCK_READ1(pVictim,MAP_LOCK_TYPE_AURAS);
+
// differentiate for weapon damage based spells
bool isWeaponDamageBasedSpell = !(spellProto && (damagetype == DOT || IsSpellHaveEffect(spellProto, SPELL_EFFECT_SCHOOL_DAMAGE)));
Item* pWeapon = GetTypeId() == TYPEID_PLAYER ? ((Player*)this)->GetWeaponForAttack(attType,true,false) : NULL;