*Fix the bug that players lose stats when change weapons when have disarm auras.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-06-10 10:13:45 -05:00
parent 40e353a9ca
commit b8f95e0546
3 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_A
m_regenHealth(true), m_AI_locked(false), m_isDeadByDefault(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL), m_summonMask(SUMMON_MASK_NONE)
, m_AlreadySearchedAssistance(false)
, m_creatureData(NULL)
, m_creatureData(NULL), m_PlayerDamageReq(0)
{
m_regenTimer = 200;
m_valuesCount = UNIT_END;
+1 -1
View File
@@ -6502,7 +6502,7 @@ void Player::_ApplyItemMods(Item *item, uint8 slot,bool apply)
uint8 attacktype = Player::GetAttackBySlot(slot);
//check disarm only on mod apply to allow remove item mods
if (apply && !CanUseAttackType(attacktype) )
if (!CanUseAttackType(attacktype) )
return;
if(attacktype < MAX_ATTACK)
+8 -7
View File
@@ -3907,17 +3907,19 @@ void AuraEffect::HandleAuraModDisarm(bool apply, bool Real, bool /*changeAmount*
default:
return;
}
if(apply)
m_target->SetFlag(field, flag);
else
m_target->RemoveFlag(field, flag);
if (m_target->GetTypeId() == TYPEID_PLAYER)
{
if(Item *pItem = ((Player*)m_target)->GetItemByPos( INVENTORY_SLOT_BAG_0, slot ))
((Player*)m_target)->_ApplyItemMods(pItem, slot, !apply);
}
else if (((Creature*)m_target)->GetCurrentEquipmentId())
if(apply)
m_target->SetFlag(field, flag);
else
m_target->RemoveFlag(field, flag);
if (m_target->GetTypeId() == TYPEID_UNIT && ((Creature*)m_target)->GetCurrentEquipmentId())
m_target->UpdateDamagePhysical(attType);
}
@@ -5418,8 +5420,7 @@ void AuraEffect::HandleModDamageDone(bool apply, bool Real, bool changeAmount)
m_target->ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_NEG+i,m_amount,apply);
}
}
Pet* pet = ((Player*)m_target)->GetPet();
if(pet)
if(Guardian* pet = ((Player*)m_target)->GetGuardianPet())
pet->UpdateAttackPowerAndDamage();
}
}