aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/game/GameObject.cpp7
-rw-r--r--src/game/Player.cpp4
-rw-r--r--src/game/Unit.cpp8
3 files changed, 13 insertions, 6 deletions
diff --git a/src/game/GameObject.cpp b/src/game/GameObject.cpp
index f71c08b3403..744b6679862 100644
--- a/src/game/GameObject.cpp
+++ b/src/game/GameObject.cpp
@@ -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)
diff --git a/src/game/Player.cpp b/src/game/Player.cpp
index 18426621300..9eb97ee295c 100644
--- a/src/game/Player.cpp
+++ b/src/game/Player.cpp
@@ -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;
}
diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp
index a4963e37d5b..7117449ae34 100644
--- a/src/game/Unit.cpp
+++ b/src/game/Unit.cpp
@@ -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;