aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2018-12-31 21:35:55 +0100
committerShauren <shauren.trinity@gmail.com>2018-12-31 21:41:25 +0100
commit3b5014fdae1b57add7fd204a9f9f10f3c2092b83 (patch)
tree9701a11c976afb47e0db62d8e0657d54840da1c3 /src/server/game/Spells/Spell.cpp
parent6ec338eb9aa96b2ef85a7800d5fefe426341082a (diff)
Core/Spells: Fixed ErrorCube spell missiles
Diffstat (limited to 'src/server/game/Spells/Spell.cpp')
-rw-r--r--src/server/game/Spells/Spell.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index 6150dbb4228..c49e340250b 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4291,6 +4291,8 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
}
else if (m_caster->GetTypeId() == TYPEID_UNIT)
{
+ uint32 nonRangedAmmoDisplayID = 0;
+ uint32 nonRangedAmmoInventoryType = 0;
for (uint8 i = BASE_ATTACK; i < MAX_ATTACK; ++i)
{
if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
@@ -4314,6 +4316,10 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
ammoDisplayID = 5998; // is this need fixing?
ammoInventoryType = INVTYPE_AMMO;
break;
+ default:
+ nonRangedAmmoDisplayID = itemEntry->DisplayId;
+ nonRangedAmmoInventoryType = itemEntry->InventoryType;
+ break;
}
if (ammoDisplayID)
@@ -4322,6 +4328,12 @@ void Spell::UpdateSpellCastDataAmmo(WorldPackets::Spells::SpellAmmo& ammo)
}
}
}
+
+ if (!ammoDisplayID && !ammoInventoryType)
+ {
+ ammoDisplayID = nonRangedAmmoDisplayID;
+ ammoInventoryType = nonRangedAmmoInventoryType;
+ }
}
ammo.DisplayID = ammoDisplayID;