*Fix trap radius calculation in some cases-by krz

--HG--
branch : trunk
This commit is contained in:
QAston
2009-05-10 19:21:39 +02:00
parent 9171455b73
commit 53b3c9a6dc
3 changed files with 13 additions and 6 deletions
+6 -1
View File
@@ -293,7 +293,12 @@ void GameObject::Update(uint32 /*p_time*/)
bool IsBattleGroundTrap = false;
//FIXME: this is activation radius (in different casting radius that must be selected from spell data)
//TODO: move activated state code (cast itself) to GO_ACTIVATED, in this place only check activating and set state
float radius = goInfo->trap.radius;
float radius = 0.0f;
const SpellEntry *spellEntry = sSpellStore.LookupEntry(m_spellId);
if(spellEntry)
radius = GetSpellRadius(sSpellRadiusStore.LookupEntry(spellEntry->EffectRadiusIndex[0]));
else
radius = goInfo->trap.radius;
if(!radius)
{
if(goInfo->trap.cooldown != 3) // cast in other case (at some triggering/linked go/etc explicit call)
+2 -2
View File
@@ -7007,7 +7007,7 @@ void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo)
return;
// Can do effect if any damage done to target
if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE)
if (damageInfo->damage)
{
for (int i = 0; i < 5; i++)
{
@@ -7071,7 +7071,7 @@ void Player::CastItemCombatSpell(Item *item, CalcDamageInfo *damageInfo)
else
{
// Can do effect if any damage done to target
if (!(damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE))
if (!(damageInfo->damage))
continue;
}
+5 -3
View File
@@ -1626,6 +1626,8 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
case BASE_ATTACK: slot = EQUIPMENT_SLOT_MAINHAND; break;
case OFF_ATTACK: slot = EQUIPMENT_SLOT_OFFHAND; break;
case RANGED_ATTACK: slot = EQUIPMENT_SLOT_RANGED; break;
default:
slot=EQUIPMENT_SLOT_END;
}
// offhand item cannot proc from main hand hit etc
if (slot != i)
@@ -1638,7 +1640,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
if (!((Player*)this)->IsUseEquipedWeapon(true))
slot=EQUIPMENT_SLOT_END;
}
else
else if (damageInfo->attackType == OFF_ATTACK)
{
if (((Player*)this)->IsInFeralForm())
slot=EQUIPMENT_SLOT_END;
@@ -1647,12 +1649,12 @@ void Unit::DealMeleeDamage(CalcDamageInfo *damageInfo, bool durabilityLoss)
}
// If usable, try to cast item spell
if(slot!=EQUIPMENT_SLOT_END)
(((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0,i), &damageInfo);
((Player*)this)->CastItemCombatSpell(((Player*)this)->GetItemByPos(INVENTORY_SLOT_BAG_0,i), damageInfo);
}
}
// Do effect if any damage done to target
if (damageInfo->procVictim & PROC_FLAG_TAKEN_ANY_DAMAGE)
if (damageInfo->damage)
{
// victim's damage shield
std::set<Aura*> alreadyDone;