mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-26 21:13:51 +00:00
chore(renderer): extract AnimationController and remove audio pass-throughs
Extract ~1,500 lines of character animation state from Renderer into a dedicated
AnimationController class, and complete the AudioCoordinator migration by removing
all 10 audio pass-through getters from Renderer.
AnimationController:
- New: include/rendering/animation_controller.hpp (182 lines)
- New: src/rendering/animation_controller.cpp (1,703 lines)
- Moves: locomotion state machine (50+ members), mount animation (40+ members),
emote system, footstep triggering, surface detection, melee combat animations
- Renderer holds std::unique_ptr<AnimationController> and delegates completely
- AnimationController accesses audio via renderer_->getAudioCoordinator()
Audio caller migration:
- Migrate ~60 external callers from renderer->getXManager() to AudioCoordinator
directly, grouped by access pattern:
- UIServices: settings_panel, game_screen, toast_manager, chat_panel,
combat_ui, window_manager
- GameServices: game_handler, spell_handler, inventory_handler, quest_handler,
social_handler, combat_handler
- Application singleton: application.cpp, auth_screen.cpp, lua_engine.cpp
- Remove 10 pass-through getter definitions from renderer.cpp
- Remove 10 pass-through getter declarations from renderer.hpp
- Remove individual audio manager forward declarations from renderer.hpp
- Redirect 69 internal renderer.cpp audio calls to audioCoordinator_ directly
- game_handler.cpp: withSoundManager template uses services_.audioCoordinator;
MFP changed from &Renderer::getUiSoundManager to &AudioCoordinator::getUiSoundManager
- GameServices struct: add AudioCoordinator* audioCoordinator member
- settings_panel: applyAudioVolumes(Renderer*) -> applyAudioVolumes(AudioCoordinator*)
This commit is contained in:
parent
5ef600098a
commit
5af9f7aa4b
22 changed files with 2208 additions and 1958 deletions
|
|
@ -6,6 +6,7 @@
|
|||
#include "game/update_field_table.hpp"
|
||||
#include "game/opcode_table.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/combat_sound_manager.hpp"
|
||||
#include "audio/activity_sound_manager.hpp"
|
||||
#include "core/application.hpp"
|
||||
|
|
@ -451,8 +452,8 @@ void CombatHandler::handleAttackerStateUpdate(network::Packet& packet) {
|
|||
}
|
||||
|
||||
// Play combat sounds via CombatSoundManager + character vocalizations
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* csm = renderer->getCombatSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* csm = ac->getCombatSoundManager()) {
|
||||
auto weaponSize = audio::CombatSoundManager::WeaponSize::MEDIUM;
|
||||
if (data.isMiss()) {
|
||||
csm->playWeaponMiss(false);
|
||||
|
|
@ -466,7 +467,7 @@ void CombatHandler::handleAttackerStateUpdate(network::Packet& packet) {
|
|||
}
|
||||
}
|
||||
// Character vocalizations
|
||||
if (auto* asm_ = renderer->getActivitySoundManager()) {
|
||||
if (auto* asm_ = ac->getActivitySoundManager()) {
|
||||
if (isPlayerAttacker && !data.isMiss() && data.victimState != 1 && data.victimState != 2) {
|
||||
asm_->playAttackGrunt();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@
|
|||
#include "game/update_field_table.hpp"
|
||||
#include "game/expansion_profile.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/activity_sound_manager.hpp"
|
||||
#include "audio/combat_sound_manager.hpp"
|
||||
#include "audio/spell_sound_manager.hpp"
|
||||
|
|
@ -599,8 +600,8 @@ static QuestQueryRewards tryParseQuestRewards(const std::vector<uint8_t>& data,
|
|||
|
||||
template<typename ManagerGetter, typename Callback>
|
||||
void GameHandler::withSoundManager(ManagerGetter getter, Callback cb) {
|
||||
if (auto* renderer = services_.renderer) {
|
||||
if (auto* mgr = (renderer->*getter)()) cb(mgr);
|
||||
if (auto* ac = services_.audioCoordinator) {
|
||||
if (auto* mgr = (ac->*getter)()) cb(mgr);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1198,9 +1199,9 @@ void GameHandler::updateTimers(float deltaTime) {
|
|||
}
|
||||
if (!alreadyAnnounced && pendingLootMoneyAmount_ > 0) {
|
||||
addSystemChatMessage("Looted: " + formatCopperAmount(pendingLootMoneyAmount_));
|
||||
auto* renderer = services_.renderer;
|
||||
if (renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager()) {
|
||||
auto* ac = services_.audioCoordinator;
|
||||
if (ac) {
|
||||
if (auto* sfx = ac->getUiSoundManager()) {
|
||||
if (pendingLootMoneyAmount_ >= 10000) {
|
||||
sfx->playLootCoinLarge();
|
||||
} else {
|
||||
|
|
@ -1974,7 +1975,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
ping.age = 0.0f;
|
||||
minimapPings_.push_back(ping);
|
||||
if (senderGuid != playerGuid) {
|
||||
withSoundManager(&rendering::Renderer::getUiSoundManager, [](auto* sfx) { sfx->playMinimapPing(); });
|
||||
withSoundManager(&audio::AudioCoordinator::getUiSoundManager, [](auto* sfx) { sfx->playMinimapPing(); });
|
||||
}
|
||||
};
|
||||
dispatchTable_[Opcode::SMSG_ZONE_UNDER_ATTACK] = [this](network::Packet& packet) {
|
||||
|
|
@ -2124,7 +2125,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
if (info && info->type == 17) {
|
||||
addUIError("A fish is on your line!");
|
||||
addSystemChatMessage("A fish is on your line!");
|
||||
withSoundManager(&rendering::Renderer::getUiSoundManager, [](auto* sfx) { sfx->playQuestUpdate(); });
|
||||
withSoundManager(&audio::AudioCoordinator::getUiSoundManager, [](auto* sfx) { sfx->playQuestUpdate(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2350,7 +2351,7 @@ void GameHandler::registerOpcodeHandlers() {
|
|||
}
|
||||
if (newLevel > oldLevel) {
|
||||
addSystemChatMessage("You have reached level " + std::to_string(newLevel) + "!");
|
||||
withSoundManager(&rendering::Renderer::getUiSoundManager, [](auto* sfx) { sfx->playLevelUp(); });
|
||||
withSoundManager(&audio::AudioCoordinator::getUiSoundManager, [](auto* sfx) { sfx->playLevelUp(); });
|
||||
if (levelUpCallback_) levelUpCallback_(newLevel);
|
||||
fireAddonEvent("PLAYER_LEVEL_UP", {std::to_string(newLevel)});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "game/entity.hpp"
|
||||
#include "game/packet_parsers.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/ui_sound_manager.hpp"
|
||||
#include "core/application.hpp"
|
||||
#include "core/logger.hpp"
|
||||
|
|
@ -70,9 +71,9 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
}
|
||||
if (!alreadyAnnounced) {
|
||||
owner_.addSystemChatMessage("Looted: " + formatCopperAmount(amount));
|
||||
auto* renderer = owner_.services().renderer;
|
||||
if (renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager()) {
|
||||
auto* ac = owner_.services().audioCoordinator;
|
||||
if (ac) {
|
||||
if (auto* sfx = ac->getUiSoundManager()) {
|
||||
if (amount >= 10000) sfx->playLootCoinLarge();
|
||||
else sfx->playLootCoinSmall();
|
||||
}
|
||||
|
|
@ -222,8 +223,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
std::string msg = "Received item: " + link;
|
||||
if (count > 1) msg += " x" + std::to_string(count);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playLootItem();
|
||||
}
|
||||
if (owner_.addonEventCallback_) {
|
||||
|
|
@ -253,8 +254,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
" result=", static_cast<int>(result));
|
||||
if (result == 0) {
|
||||
pendingSellToBuyback_.erase(itemGuid);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playDropOnGround();
|
||||
}
|
||||
if (owner_.addonEventCallback_) {
|
||||
|
|
@ -295,8 +296,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
const char* msg = (result < 7) ? sellErrors[result] : "Unknown sell error";
|
||||
owner_.addUIError(std::string("Sell failed: ") + msg);
|
||||
owner_.addSystemChatMessage(std::string("Sell failed: ") + msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
LOG_WARNING("SMSG_SELL_ITEM error: ", (int)result, " (", msg, ")");
|
||||
|
|
@ -392,8 +393,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
std::string msg = errMsg ? errMsg : "Inventory error (" + std::to_string(error) + ").";
|
||||
owner_.addUIError(msg);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
}
|
||||
|
|
@ -450,8 +451,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
}
|
||||
owner_.addUIError(msg);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
}
|
||||
|
|
@ -474,8 +475,8 @@ void InventoryHandler::registerOpcodes(DispatchTable& table) {
|
|||
std::string msg = "Purchased: " + buildItemLink(pendingBuyItemId_, buyQuality, itemLabel);
|
||||
if (itemCount > 1) msg += " x" + std::to_string(itemCount);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playPickupBag();
|
||||
}
|
||||
}
|
||||
|
|
@ -766,8 +767,8 @@ void InventoryHandler::handleLootRemoved(network::Packet& packet) {
|
|||
std::string msgStr = "Looted: " + link;
|
||||
if (it->count > 1) msgStr += " x" + std::to_string(it->count);
|
||||
owner_.addSystemChatMessage(msgStr);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playLootItem();
|
||||
}
|
||||
currentLoot_.items.erase(it);
|
||||
|
|
@ -2382,8 +2383,8 @@ void InventoryHandler::handleItemQueryResponse(network::Packet& packet) {
|
|||
std::string msg = "Received: " + link;
|
||||
if (it->count > 1) msg += " x" + std::to_string(it->count);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager()) sfx->playLootItem();
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager()) sfx->playLootItem();
|
||||
}
|
||||
if (owner_.itemLootCallback_) owner_.itemLootCallback_(data.entry, it->count, data.quality, itemName);
|
||||
it = owner_.pendingItemPushNotifs_.erase(it);
|
||||
|
|
@ -3149,8 +3150,8 @@ void InventoryHandler::handleTrainerBuySucceeded(network::Packet& packet) {
|
|||
owner_.addSystemChatMessage("You have learned " + name + ".");
|
||||
else
|
||||
owner_.addSystemChatMessage("Spell learned.");
|
||||
if (auto* renderer = owner_.services().renderer)
|
||||
if (auto* sfx = renderer->getUiSoundManager()) sfx->playQuestActivate();
|
||||
if (auto* ac = owner_.services().audioCoordinator)
|
||||
if (auto* sfx = ac->getUiSoundManager()) sfx->playQuestActivate();
|
||||
owner_.fireAddonEvent("TRAINER_UPDATE", {});
|
||||
owner_.fireAddonEvent("SPELLS_CHANGED", {});
|
||||
}
|
||||
|
|
@ -3171,8 +3172,8 @@ void InventoryHandler::handleTrainerBuyFailed(network::Packet& packet) {
|
|||
else if (errorCode != 0) msg += " (error " + std::to_string(errorCode) + ")";
|
||||
owner_.addUIError(msg);
|
||||
owner_.addSystemChatMessage(msg);
|
||||
if (auto* renderer = owner_.services().renderer)
|
||||
if (auto* sfx = renderer->getUiSoundManager()) sfx->playError();
|
||||
if (auto* ac = owner_.services().audioCoordinator)
|
||||
if (auto* sfx = ac->getUiSoundManager()) sfx->playError();
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include "game/packet_parsers.hpp"
|
||||
#include "network/world_socket.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/ui_sound_manager.hpp"
|
||||
#include "core/application.hpp"
|
||||
#include "core/logger.hpp"
|
||||
|
|
@ -469,8 +470,8 @@ void QuestHandler::registerOpcodes(DispatchTable& table) {
|
|||
owner_.questCompleteCallback_(questId, it->title);
|
||||
}
|
||||
// Play quest-complete sound
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playQuestComplete();
|
||||
}
|
||||
questLog_.erase(it);
|
||||
|
|
@ -1095,8 +1096,8 @@ void QuestHandler::acceptQuest() {
|
|||
pendingQuestAcceptNpcGuids_[questId] = npcGuid;
|
||||
|
||||
// Play quest-accept sound
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playQuestActivate();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include "game/packet_parsers.hpp"
|
||||
#include "game/update_field_table.hpp"
|
||||
#include "game/opcode_table.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/ui_sound_manager.hpp"
|
||||
#include "network/world_socket.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
|
|
@ -1053,8 +1054,8 @@ void SocialHandler::handleDuelRequested(network::Packet& packet) {
|
|||
}
|
||||
pendingDuelRequest_ = true;
|
||||
owner_.addSystemChatMessage(duelChallengerName_ + " challenges you to a duel!");
|
||||
if (auto* renderer = owner_.services().renderer)
|
||||
if (auto* sfx = renderer->getUiSoundManager()) sfx->playTargetSelect();
|
||||
if (auto* ac = owner_.services().audioCoordinator)
|
||||
if (auto* sfx = ac->getUiSoundManager()) sfx->playTargetSelect();
|
||||
if (owner_.addonEventCallback_) owner_.addonEventCallback_("DUEL_REQUESTED", {duelChallengerName_});
|
||||
}
|
||||
|
||||
|
|
@ -1219,8 +1220,8 @@ void SocialHandler::handleGroupInvite(network::Packet& packet) {
|
|||
pendingInviterName = data.inviterName;
|
||||
if (!data.inviterName.empty())
|
||||
owner_.addSystemChatMessage(data.inviterName + " has invited you to a group.");
|
||||
if (auto* renderer = owner_.services().renderer)
|
||||
if (auto* sfx = renderer->getUiSoundManager()) sfx->playTargetSelect();
|
||||
if (auto* ac = owner_.services().audioCoordinator)
|
||||
if (auto* sfx = ac->getUiSoundManager()) sfx->playTargetSelect();
|
||||
if (owner_.addonEventCallback_)
|
||||
owner_.addonEventCallback_("PARTY_INVITE_REQUEST", {data.inviterName});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#include "game/packet_parsers.hpp"
|
||||
#include "game/entity.hpp"
|
||||
#include "rendering/renderer.hpp"
|
||||
#include "audio/audio_coordinator.hpp"
|
||||
#include "audio/spell_sound_manager.hpp"
|
||||
#include "audio/combat_sound_manager.hpp"
|
||||
#include "core/application.hpp"
|
||||
|
|
@ -795,8 +796,8 @@ void SpellHandler::handleCastFailed(network::Packet& packet) {
|
|||
queuedSpellTarget_ = 0;
|
||||
|
||||
// Stop precast sound
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
ssm->stopPrecast();
|
||||
}
|
||||
}
|
||||
|
|
@ -817,8 +818,8 @@ void SpellHandler::handleCastFailed(network::Packet& packet) {
|
|||
msg.message = errMsg;
|
||||
owner_.addLocalChatMessage(msg);
|
||||
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playError();
|
||||
}
|
||||
|
||||
|
|
@ -869,8 +870,8 @@ void SpellHandler::handleSpellStart(network::Packet& packet) {
|
|||
|
||||
// Play precast sound — skip profession/tradeskill spells
|
||||
if (!owner_.isProfessionSpell(data.spellId)) {
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
owner_.loadSpellNameCache();
|
||||
auto it = owner_.spellNameCache_.find(data.spellId);
|
||||
auto school = (it != owner_.spellNameCache_.end() && it->second.schoolMask)
|
||||
|
|
@ -907,8 +908,8 @@ void SpellHandler::handleSpellGo(network::Packet& packet) {
|
|||
if (data.casterUnit == owner_.playerGuid) {
|
||||
// Play cast-complete sound
|
||||
if (!owner_.isProfessionSpell(data.spellId)) {
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
owner_.loadSpellNameCache();
|
||||
auto it = owner_.spellNameCache_.find(data.spellId);
|
||||
auto school = (it != owner_.spellNameCache_.end() && it->second.schoolMask)
|
||||
|
|
@ -931,8 +932,8 @@ void SpellHandler::handleSpellGo(network::Packet& packet) {
|
|||
}
|
||||
if (isMeleeAbility) {
|
||||
if (owner_.meleeSwingCallback_) owner_.meleeSwingCallback_();
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* csm = renderer->getCombatSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* csm = ac->getCombatSoundManager()) {
|
||||
csm->playWeaponSwing(audio::CombatSoundManager::WeaponSize::MEDIUM, false);
|
||||
csm->playImpact(audio::CombatSoundManager::WeaponSize::MEDIUM,
|
||||
audio::CombatSoundManager::ImpactType::FLESH, false);
|
||||
|
|
@ -990,8 +991,8 @@ void SpellHandler::handleSpellGo(network::Packet& packet) {
|
|||
if (tgt == owner_.playerGuid) { targetsPlayer = true; break; }
|
||||
}
|
||||
if (targetsPlayer) {
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
owner_.loadSpellNameCache();
|
||||
auto it = owner_.spellNameCache_.find(data.spellId);
|
||||
auto school = (it != owner_.spellNameCache_.end() && it->second.schoolMask)
|
||||
|
|
@ -1036,8 +1037,8 @@ void SpellHandler::handleSpellGo(network::Packet& packet) {
|
|||
}
|
||||
|
||||
if (playerIsHit || playerHitEnemy) {
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
owner_.loadSpellNameCache();
|
||||
auto it = owner_.spellNameCache_.find(data.spellId);
|
||||
auto school = (it != owner_.spellNameCache_.end() && it->second.schoolMask)
|
||||
|
|
@ -1396,8 +1397,8 @@ void SpellHandler::handleAchievementEarned(network::Packet& packet) {
|
|||
|
||||
owner_.earnedAchievements_.insert(achievementId);
|
||||
owner_.achievementDates_[achievementId] = earnDate;
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* sfx = renderer->getUiSoundManager())
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* sfx = ac->getUiSoundManager())
|
||||
sfx->playAchievementAlert();
|
||||
}
|
||||
if (owner_.achievementEarnedCallback_) {
|
||||
|
|
@ -2350,8 +2351,8 @@ void SpellHandler::handleSpellFailure(network::Packet& packet) {
|
|||
craftQueueRemaining_ = 0;
|
||||
queuedSpellId_ = 0;
|
||||
queuedSpellTarget_ = 0;
|
||||
if (auto* renderer = owner_.services().renderer) {
|
||||
if (auto* ssm = renderer->getSpellSoundManager()) {
|
||||
if (auto* ac = owner_.services().audioCoordinator) {
|
||||
if (auto* ssm = ac->getSpellSoundManager()) {
|
||||
ssm->stopPrecast();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue