mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
fix: suppress spell sounds and melee swing for crafting/profession spells
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Crafting spells (bandages, smelting, etc.) were playing magic precast/ cast-complete audio and triggering melee weapon swing animations because they have physical school mask (1). Re-add isProfessionSpell check to skip spell sounds and melee animation for tradeskill spells. The character still plays the generic cast animation via spellCastAnimCallback.
This commit is contained in:
parent
432da20b3e
commit
6bfa3dc402
1 changed files with 25 additions and 19 deletions
|
|
@ -19592,7 +19592,9 @@ void GameHandler::handleSpellStart(network::Packet& packet) {
|
|||
castTimeRemaining = castTimeTotal;
|
||||
if (addonEventCallback_) addonEventCallback_("CURRENT_SPELL_CAST_CHANGED", {});
|
||||
|
||||
// Play precast sound with correct magic school (including crafting spells)
|
||||
// Play precast sound — skip profession/tradeskill spells (they use crafting
|
||||
// animations/sounds, not magic spell audio).
|
||||
if (!isProfessionSpell(data.spellId)) {
|
||||
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
loadSpellNameCache();
|
||||
|
|
@ -19603,6 +19605,7 @@ void GameHandler::handleSpellStart(network::Packet& packet) {
|
|||
ssm->playPrecast(school, audio::SpellSoundManager::SpellPower::MEDIUM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Trigger cast animation on player character
|
||||
if (spellCastAnimCallback_) {
|
||||
|
|
@ -19636,7 +19639,8 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
|||
|
||||
// Cast completed
|
||||
if (data.casterUnit == playerGuid) {
|
||||
// Play cast-complete sound with correct magic school (including crafting)
|
||||
// Play cast-complete sound — skip profession spells (no magic sound for crafting)
|
||||
if (!isProfessionSpell(data.spellId)) {
|
||||
if (auto* renderer = core::Application::getInstance().getRenderer()) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
loadSpellNameCache();
|
||||
|
|
@ -19647,14 +19651,16 @@ void GameHandler::handleSpellGo(network::Packet& packet) {
|
|||
ssm->playCast(school);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Instant melee abilities → trigger attack animation
|
||||
// Detect via physical school mask (1 = Physical) from the spell DBC cache.
|
||||
// Skip profession spells — crafting should not swing weapons.
|
||||
// This covers warrior, rogue, DK, paladin, feral druid, and hunter melee
|
||||
// abilities generically instead of maintaining a brittle per-spell-ID list.
|
||||
uint32_t sid = data.spellId;
|
||||
bool isMeleeAbility = false;
|
||||
{
|
||||
if (!isProfessionSpell(sid)) {
|
||||
loadSpellNameCache();
|
||||
auto cacheIt = spellNameCache_.find(sid);
|
||||
if (cacheIt != spellNameCache_.end() && cacheIt->second.schoolMask == 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue