fix(Core/Spell): Remove ErrorCube visual (#5713)

* fix(Core/Spell): Remove ErrorCube visual

* cherry-pick https://github.com/trinitycore/trinitycore/commit/3b5014fdae

* cherry-pick small part of f4f7e6324d

Co-Authored-By: Shauren <shauren.trinity@gmail.com>
Co-Authored-By: Treeston <14020072+treeston@users.noreply.github.com>

* brackets

* Update rev_1620443413425226200.sql

* Update rev_1620443413425226200.sql

* It was the S, AN S

* Update SpellMgr.cpp

* Update SpellMgr.cpp

* Revert "Merge branch 'master' into fix-visual"

This reverts commit f0b629a2835c2a2d9aa5696bb7539c1ae9b14d57, reversing
changes made to c06f4465d15e9f71426d796e2fcfe714592c3443.

* Revert "Revert "Merge branch 'master' into fix-visual""

This reverts commit bfdf75bd6f8f06944463249de5d398a9e77c3a79.

* fix build

Co-authored-by: Shauren <shauren.trinity@gmail.com>
Co-authored-by: Treeston <14020072+treeston@users.noreply.github.com>
This commit is contained in:
Kitzunu
2021-09-15 01:38:10 +02:00
committed by GitHub
parent 7e60435812
commit a4a0976d5e
9 changed files with 111 additions and 3 deletions

View File

@@ -4313,7 +4313,7 @@ void Spell::SendSpellStart()
if (((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) && !m_spellInfo->IsChanneled())
castFlags |= CAST_FLAG_PENDING;
if (m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT))
if (m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT) || m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NEEDS_AMMO_DATA))
castFlags |= CAST_FLAG_PROJECTILE;
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
(m_caster->GetTypeId() == TYPEID_UNIT && m_caster->IsPet()))
@@ -4369,7 +4369,7 @@ void Spell::SendSpellGo()
if (((IsTriggered() && !m_spellInfo->IsAutoRepeatRangedSpell()) || m_triggeredByAuraSpell) && !m_spellInfo->IsChanneled())
castFlags |= CAST_FLAG_PENDING;
if (m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT))
if (m_spellInfo->HasAttribute(SPELL_ATTR0_USES_RANGED_SLOT) || m_spellInfo->HasAttribute(SPELL_ATTR0_CU_NEEDS_AMMO_DATA))
castFlags |= CAST_FLAG_PROJECTILE; // arrows/bullets visual
if ((m_caster->GetTypeId() == TYPEID_PLAYER ||
@@ -4495,6 +4495,8 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
}
else
{
uint32 nonRangedAmmoDisplayID = 0;
uint32 nonRangedAmmoInventoryType = 0;
for (uint8 i = 0; i < 3; ++i)
{
if (uint32 item_id = m_caster->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + i))
@@ -4518,6 +4520,10 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
ammoDisplayID = 5998; // is this need fixing?
ammoInventoryType = INVTYPE_AMMO;
break;
default:
nonRangedAmmoDisplayID = itemEntry->DisplayInfoID;
nonRangedAmmoInventoryType = itemEntry->InventoryType;
break;
}
if (ammoDisplayID)
@@ -4526,6 +4532,12 @@ void Spell::WriteAmmoToPacket(WorldPacket* data)
}
}
}
if (!ammoDisplayID && !ammoInventoryType)
{
ammoDisplayID = nonRangedAmmoDisplayID;
ammoInventoryType = nonRangedAmmoInventoryType;
}
}
*data << uint32(ammoDisplayID);