From 3de99d25ff41553e6452de3af36b12082e4947a4 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 15 Mar 2009 15:57:31 -0600 Subject: *Fix an uninitialized variable which may cause crash. --HG-- branch : trunk --- src/game/SpellAuras.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index d729ec1f182..0650190daaf 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -811,7 +811,7 @@ void Aura::_AddAura() // Try find slot for aura uint8 slot = NULL_AURA_SLOT; // Lookup for auras already applied from spell - for(uint8 i = 0; i < 3; i++) + for(uint8 i = 0; i < 3; ++i) { Unit::spellEffectPair spair = Unit::spellEffectPair(GetId(), i); for(Unit::AuraMap::const_iterator itr = m_target->GetAuras().lower_bound(spair); itr != m_target->GetAuras().upper_bound(spair); ++itr) @@ -831,7 +831,7 @@ void Aura::_AddAura() Unit::VisibleAuraMap const *visibleAuras = m_target->GetVisibleAuras(); if(visibleAuras->size() < MAX_AURAS || slot < MAX_AURAS) // got free slot { - AuraSlotEntry * entry; + AuraSlotEntry *entry = NULL; // Lookup free slot if (!secondaura) @@ -852,8 +852,8 @@ void Aura::_AddAura() entry->m_Level=(caster ? caster->getLevel() : sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)); entry->m_spellId = GetId(); //init pointers-prevent unexpected behaviour - for(uint8 i = 0; i < 3; i++) - entry->m_slotAuras[i]=NULL; + for(uint8 i = 0; i < 3; ++i) + entry->m_slotAuras[i] = NULL; } else entry = m_target->GetVisibleAura(slot); -- cgit v1.2.3