mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
fix: clear spell visual instances on map change/world entry
Active spell visual M2 instances were never cleaned up when the player teleported to a different map or re-entered the world. Orphaned effects could linger visually from the previous combat session. Now properly removes all active spell visual instances in resetCombatVisualState(), which is called on every world entry.
This commit is contained in:
parent
e24c39f4be
commit
f101ed7c83
1 changed files with 6 additions and 0 deletions
|
|
@ -3017,6 +3017,12 @@ void Renderer::resetCombatVisualState() {
|
||||||
targetPosition = nullptr;
|
targetPosition = nullptr;
|
||||||
meleeSwingTimer = 0.0f;
|
meleeSwingTimer = 0.0f;
|
||||||
meleeSwingCooldown = 0.0f;
|
meleeSwingCooldown = 0.0f;
|
||||||
|
// Clear lingering spell visual instances from the previous map/combat session.
|
||||||
|
// Without this, old effects could remain visible after teleport or map change.
|
||||||
|
for (auto& sv : activeSpellVisuals_) {
|
||||||
|
if (m2Renderer) m2Renderer->removeInstance(sv.instanceId);
|
||||||
|
}
|
||||||
|
activeSpellVisuals_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Renderer::isMoving() const {
|
bool Renderer::isMoving() const {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue