From 42d5b79eead2608c00c1068a5eec98798333fc42 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 21 Mar 2009 14:54:21 -0600 Subject: [PATCH] [7508] Revert to "check first, proccess later" code style in WorldSession::HandleRemoveGlyph. Author: VladimirMangos --HG-- branch : trunk --- src/game/CharacterHandler.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/game/CharacterHandler.cpp b/src/game/CharacterHandler.cpp index f119909a31..26223b2b0a 100644 --- a/src/game/CharacterHandler.cpp +++ b/src/game/CharacterHandler.cpp @@ -1226,21 +1226,20 @@ void WorldSession::HandleRemoveGlyph( WorldPacket & recv_data ) uint32 slot; recv_data >> slot; - if(slot < MAX_GLYPH_SLOT_INDEX) + if(slot >= MAX_GLYPH_SLOT_INDEX) { - if(uint32 glyph = _player->GetGlyph(slot)) - { - if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph)) - { - _player->RemoveAurasDueToSpell(gp->SpellId); - _player->SetGlyph(slot, 0); - } - } - + sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); return; } - sLog.outDebug("Client sent wrong glyph slot number in opcode CMSG_REMOVE_GLYPH %u", slot); + if(uint32 glyph = _player->GetGlyph(slot)) + { + if(GlyphPropertiesEntry const *gp = sGlyphPropertiesStore.LookupEntry(glyph)) + { + _player->RemoveAurasDueToSpell(gp->SpellId); + _player->SetGlyph(slot, 0); + } + } } void WorldSession::HandleCharCustomize(WorldPacket& recv_data)