aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/Spell.cpp
diff options
context:
space:
mode:
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;