diff options
Diffstat (limited to 'src/game/Chat.cpp')
-rw-r--r-- | src/game/Chat.cpp | 50 |
1 files changed, 24 insertions, 26 deletions
diff --git a/src/game/Chat.cpp b/src/game/Chat.cpp index 6e391cca247..1b39c49fb90 100644 --- a/src/game/Chat.cpp +++ b/src/game/Chat.cpp @@ -1428,12 +1428,12 @@ valid examples: c = reader.peek(); } GlyphPropertiesEntry const* glyph = sGlyphPropertiesStore.LookupEntry(glyphId); - if(!glyph) + if (!glyph) return false; linkedSpell = sSpellStore.LookupEntry(glyph->SpellId); - if(!linkedSpell) + if (!linkedSpell) return false; } else @@ -1446,10 +1446,10 @@ valid examples: break; case 'h': // if h is next element in sequence, this one must contain the linked text :) - if(*validSequenceIterator == 'h') + if (*validSequenceIterator == 'h') { // links start with '[' - if(reader.get() != '[') + if (reader.get() != '[') { #ifdef MANGOS_DEBUG sLog.outBasic("ChatHandler::isValidChatMessage link caption doesn't start with '['"); @@ -1462,18 +1462,16 @@ valid examples: if (linkedSpell) { // spells with that flag have a prefix of "$PROFESSION: " - if(linkedSpell->Attributes & SPELL_ATTR_TRADESPELL) + if (linkedSpell->Attributes & SPELL_ATTR_TRADESPELL) { // lookup skillid - SkillLineAbilityMap::const_iterator lower = spellmgr.GetBeginSkillLineAbilityMap(linkedSpell->Id); - SkillLineAbilityMap::const_iterator upper = spellmgr.GetEndSkillLineAbilityMap(linkedSpell->Id); - - if(lower == upper) + SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(linkedSpell->Id); + if (bounds.first == bounds.second) { return false; } - SkillLineAbilityEntry const *skillInfo = lower->second; + SkillLineAbilityEntry const *skillInfo = bounds.first->second; if (!skillInfo) { @@ -1481,7 +1479,7 @@ valid examples: } SkillLineEntry const *skillLine = sSkillLineStore.LookupEntry(skillInfo->skillId); - if(!skillLine) + if (!skillLine) { return false; } @@ -1489,7 +1487,7 @@ valid examples: for(uint8 i=0; i<MAX_LOCALE; ++i) { uint32 skillLineNameLength = strlen(skillLine->name[i]); - if(skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0) + if (skillLineNameLength > 0 && strncmp(skillLine->name[i], buffer, skillLineNameLength) == 0) { // found the prefix, remove it to perform spellname validation below // -2 = strlen(": ") @@ -1501,22 +1499,22 @@ valid examples: bool foundName = false; for(uint8 i=0; i<MAX_LOCALE; ++i) { - if(*linkedSpell->SpellName[i] && strcmp(linkedSpell->SpellName[i], buffer) == 0) + if (*linkedSpell->SpellName[i] && strcmp(linkedSpell->SpellName[i], buffer) == 0) { foundName = true; break; } } - if(!foundName) + if (!foundName) return false; } - else if(linkedQuest) + else if (linkedQuest) { if (linkedQuest->GetTitle() != buffer) { QuestLocale const *ql = objmgr.GetQuestLocale(linkedQuest->GetQuestId()); - if(!ql) + if (!ql) { #ifdef MANOGS_DEBUG sLog.outBasic("ChatHandler::isValidChatMessage default questname didn't match and there is no locale"); @@ -1527,13 +1525,13 @@ valid examples: bool foundName = false; for(uint8 i=0; i<ql->Title.size(); i++) { - if(ql->Title[i] == buffer) + if (ql->Title[i] == buffer) { foundName = true; break; } } - if(!foundName) + if (!foundName) { #ifdef MANOGS_DEBUG sLog.outBasic("ChatHandler::isValidChatMessage no quest locale title matched") @@ -1544,11 +1542,11 @@ valid examples: } else if(linkedItem) { - if(strcmp(linkedItem->Name1, buffer) != 0) + if (strcmp(linkedItem->Name1, buffer) != 0) { ItemLocale const *il = objmgr.GetItemLocale(linkedItem->ItemId); - if(!il) + if (!il) { #ifdef MANGOS_DEBUG sLog.outBasic("ChatHandler::isValidChatMessage linked item name doesn't is wrong and there is no localization"); @@ -1559,13 +1557,13 @@ valid examples: bool foundName = false; for(uint8 i=0; i<il->Name.size(); ++i) { - if(il->Name[i] == buffer) + if (il->Name[i] == buffer) { foundName = true; break; } } - if(!foundName) + if (!foundName) { #ifdef MANGOS_DEBUG sLog.outBasic("ChatHandler::isValidChatMessage linked item name wasn't found in any localization"); @@ -1574,18 +1572,18 @@ valid examples: } } } - else if(linkedAchievement) + else if (linkedAchievement) { bool foundName = false; for(uint8 i=0; i<MAX_LOCALE; ++i) { - if(*linkedAchievement->name[i], strcmp(linkedAchievement->name[i], buffer) == 0) + if (*linkedAchievement->name[i], strcmp(linkedAchievement->name[i], buffer) == 0) { foundName = true; break; } } - if(!foundName) + if (!foundName) return false; } // that place should never be reached - if nothing linked has been set in |H @@ -2370,4 +2368,4 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const int CliHandler::GetSessionDbLocaleIndex() const { return objmgr.GetDBCLocaleIndex(); -} +}
\ No newline at end of file |