Build/Clang: fixed 96 warnings + improved code readability

This commit is contained in:
ShinDarth
2016-08-16 23:21:38 +02:00
parent 9802678689
commit a4589f71d5
29 changed files with 134 additions and 63 deletions

View File

@@ -4200,8 +4200,8 @@ void Player::removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporar
continue;
// pussywizard: don't understand why whole skill is removed when just single spell from it is removed
if (_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS || // pussywizard: don't unlearn class skills
(pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0)
if ((_spell_idx->second->learnOnGetSkill == ABILITY_LEARNED_ON_GET_RACE_OR_CLASS_SKILL && pSkill->categoryId != SKILL_CATEGORY_CLASS) || // pussywizard: don't unlearn class skills
((pSkill->id == SKILL_LOCKPICKING || pSkill->id == SKILL_RUNEFORGING) && _spell_idx->second->max_value == 0))
{
// not reset skills for professions and racial abilities
if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) && (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0))
@@ -17494,7 +17494,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
MapEntry const* mapEntry = sMapStore.LookupEntry(mapId);
// pussywizard: group changed difficulty when player was offline, teleport to the enterance of new difficulty
if (mapEntry && (mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty() || mapEntry->IsRaid() && raidDiff != GetRaidDifficulty()))
if (mapEntry && ((mapEntry->IsNonRaidDungeon() && dungeonDiff != GetDungeonDifficulty()) ||
(mapEntry->IsRaid() && raidDiff != GetRaidDifficulty())))
{
bool fixed = false;
if (uint32 destInstId = sInstanceSaveMgr->PlayerGetDestinationInstanceId(this, mapId, GetDifficulty(mapEntry->IsRaid())))
@@ -22840,7 +22841,9 @@ void Player::ApplyEquipCooldown(Item* pItem)
// xinef: dont apply equip cooldown if spell on item has insignificant cooldown
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellData.SpellId);
if (spellData.SpellCooldown <= 3000 && spellData.SpellCategoryCooldown <= 3000 && (!spellInfo || spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000))
if (spellData.SpellCooldown <= 3000 &&
spellData.SpellCategoryCooldown <= 3000 &&
(!spellInfo || (spellInfo->RecoveryTime <= 3000 && spellInfo->CategoryRecoveryTime <= 3000)))
continue;
// Don't replace longer cooldowns by equip cooldown if we have any.
@@ -26371,7 +26374,10 @@ uint8 Player::GetMostPointsTalentTree() const
bool Player::IsHealerTalentSpec() const
{
uint8 tree = GetMostPointsTalentTree();
return (getClass() == CLASS_DRUID && tree == 2 || getClass() == CLASS_PALADIN && tree == 0 || getClass() == CLASS_PRIEST && tree <= 1 || getClass() == CLASS_SHAMAN && tree == 2);
return ((getClass() == CLASS_DRUID && tree == 2) ||
(getClass() == CLASS_PALADIN && tree == 0) ||
(getClass() == CLASS_PRIEST && tree <= 1) ||
(getClass() == CLASS_SHAMAN && tree == 2));
}
void Player::ResetTimeSync()