fix: wire SpellHandler::updateTimers and remove stale cast state members

SpellHandler::updateTimers() was never called after PR #23 extraction,
so cast bar timers, spell cooldowns, and unit cast state timers never
ticked. Also removes duplicate cast/queue/spell members left in
GameHandler that shadowed the SpellHandler versions, and fixes
MovementHandler writing to those stale members on world portal.

Demotes SMSG_SPELL_START/CAST_RESULT debug logs to LOG_DEBUG.
This commit is contained in:
Kelsi 2026-03-29 16:49:17 -07:00
parent d32b35c583
commit 209c257745
5 changed files with 15 additions and 45 deletions

View file

@ -688,10 +688,6 @@ GameHandler::GameHandler() {
wardenHandler_ = std::make_unique<WardenHandler>(*this);
wardenHandler_->initModuleManager();
// Default spells always available
knownSpells.insert(6603); // Attack
knownSpells.insert(8690); // Hearthstone
// Default action bar layout
actionBar[0].type = ActionBarSlot::SPELL;
actionBar[0].id = 6603; // Attack in slot 1
@ -1118,6 +1114,8 @@ for (auto& [guid, entity] : entityController_->getEntityManager().getEntities())
}
void GameHandler::updateTimers(float deltaTime) {
if (spellHandler_) spellHandler_->updateTimers(deltaTime);
if (auctionSearchDelayTimer_ > 0.0f) {
auctionSearchDelayTimer_ -= deltaTime;
if (auctionSearchDelayTimer_ < 0.0f) auctionSearchDelayTimer_ = 0.0f;
@ -4637,14 +4635,9 @@ void GameHandler::selectCharacter(uint64_t characterGuid) {
pendingQuestAcceptNpcGuids_.clear();
npcQuestStatus_.clear();
if (combatHandler_) combatHandler_->resetAllCombatState();
if (spellHandler_) { spellHandler_->casting_ = false; spellHandler_->castIsChannel_ = false; spellHandler_->currentCastSpellId_ = 0; }
if (spellHandler_) spellHandler_->resetCastState();
pendingGameObjectInteractGuid_ = 0;
lastInteractedGoGuid_ = 0;
if (spellHandler_) { spellHandler_->castTimeRemaining_ = 0.0f; spellHandler_->castTimeTotal_ = 0.0f; }
craftQueueSpellId_ = 0;
craftQueueRemaining_ = 0;
queuedSpellId_ = 0;
queuedSpellTarget_ = 0;
playerDead_ = false;
releasedSpirit_ = false;
corpseGuid_ = 0;