[7508] Revert to "check first, proccess later" code style in WorldSession::HandleRemoveGlyph.

This commit is contained in:
VladimirMangos 2009-03-21 19:44:22 +03:00
parent 28dc20c6e2
commit befa6c5c86
2 changed files with 11 additions and 12 deletions

View file

@ -1210,21 +1210,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)