Apply style fix pt4

This commit is contained in:
Antz 2020-01-14 10:26:15 +00:00
parent d93dbd95fe
commit 4727d8846f
87 changed files with 710 additions and 0 deletions

View file

@ -338,7 +338,9 @@ void ArenaTeam::DelMember(ObjectGuid guid)
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
// delete all info regarding this team
for (int i = 0; i < ARENA_TEAM_END; ++i)
{
player->SetArenaTeamInfoField(GetSlot(), ArenaTeamInfoType(i), 0);
}
}
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u' AND guid = '%u'", GetId(), guid.GetCounter());

View file

@ -1838,7 +1838,9 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
m_equipmentId = equip_entry;
for (uint8 i = 0; i < MAX_VIRTUAL_ITEM_SLOT; ++i)
{
SetVirtualItem(VirtualItemSlot(i), einfo->equipentry[i]);
}
}
bool Creature::HasQuest(uint32 quest_id) const

View file

@ -96,7 +96,9 @@ void CreatureEventAIMgr::CheckUnusedAITexts()
}
for (std::set<int32>::const_iterator itr = idx_set.begin(); itr != idx_set.end(); ++itr)
{
sLog.outErrorEventAI("Entry %i in table `creature_ai_texts` but not used in EventAI scripts.", *itr);
}
}
/// Helper function to check if a target-type is suitable for the event-type
@ -229,7 +231,9 @@ void CreatureEventAIMgr::CheckUnusedAISummons()
std::set<int32> idx_set;
// check not used strings this is negative range
for (CreatureEventAI_Summon_Map::const_iterator itr = m_CreatureEventAI_Summon_Map.begin(); itr != m_CreatureEventAI_Summon_Map.end(); ++itr)
{
idx_set.insert(itr->first);
}
for (CreatureEventAI_Event_Map::const_iterator itr = m_CreatureEventAI_Event_Map.begin(); itr != m_CreatureEventAI_Event_Map.end(); ++itr)
{
@ -255,7 +259,9 @@ void CreatureEventAIMgr::CheckUnusedAISummons()
}
for (std::set<int32>::const_iterator itr = idx_set.begin(); itr != idx_set.end(); ++itr)
{
sLog.outErrorEventAI("Entry %i in table `creature_ai_summons` but not used in EventAI scripts.", *itr);
}
}
// -------------------

View file

@ -108,7 +108,9 @@ Guild::Guild()
m_GuildEventLogNextGuid = 0;
m_GuildBankEventLogNextGuid_Money = 0;
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
{
m_GuildBankEventLogNextGuid_Item[i] = 0;
}
}
Guild::~Guild()
@ -245,7 +247,9 @@ bool Guild::AddMember(ObjectGuid plGuid, uint32 plRank)
newmember.LogoutTime = time(NULL);
newmember.BankResetTimeMoney = 0; // this will force update at first query
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
{
newmember.BankResetTimeTab[i] = 0;
}
members[lowguid] = newmember;
std::string dbPnote = newmember.Pnote;
@ -333,7 +337,9 @@ bool Guild::LoadGuildFromDB(QueryResult* guildDataResult)
m_TabListMap.resize(purchasedTabs);
for (uint8 i = 0; i < purchasedTabs; ++i)
{
m_TabListMap[i] = new GuildBankTab;
}
return true;
}
@ -1115,7 +1121,9 @@ void Guild::QueryRanks(WorldSession* session)
data.WriteBits(m_Ranks.size(), 18);
for (uint8 i = 0; i < m_Ranks.size(); ++i)
{
data.WriteBits(m_Ranks[i].Name.length(), 7);
}
for (uint8 i = 0; i < m_Ranks.size(); ++i)
{
@ -1183,7 +1191,9 @@ void Guild::DisplayGuildEventLog(WorldSession* session)
// count, max count == 100
data.WriteBits(m_GuildEventLog.size(), 23);
for (GuildEventLog::iterator itr = m_GuildEventLog.begin(); itr != m_GuildEventLog.end(); ++itr)
{
itr->WriteData(data, buffer);
}
if (!buffer.empty())
{
data.FlushBits();
@ -1378,7 +1388,9 @@ void Guild::DisplayGuildBankContentUpdate(uint8 TabId, GuildItemPosCountVec cons
data.WriteBits(0, 22); // Tell client that there's no tab info in this packet
for (GuildItemPosCountVec::const_iterator itr = slots.begin(); itr != slots.end(); ++itr)
{
AppendDisplayGuildBankSlot(data, buffer, tab, itr->Slot);
}
data << uint64(GetGuildBankMoney());
if (!buffer.empty())
@ -1774,7 +1786,9 @@ void Guild::SetBankRightsAndSlots(uint32 rankId, uint8 TabId, uint32 right, uint
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
if (itr->second.RankId == rankId)
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
{
itr->second.BankResetTimeTab[i] = 0;
}
CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid='%u' AND TabId='%u' AND rid='%u'", m_Id, uint32(TabId), rankId);
CharacterDatabase.PExecute("INSERT INTO guild_bank_right (guildid,TabId,rid,gbright,SlotPerDay) VALUES "
@ -1960,7 +1974,9 @@ void Guild::DisplayGuildBankLogs(WorldSession* session, uint8 TabId)
// Here we display money logs
data.WriteBits(m_GuildBankEventLog_Money.size(), 23);
for (GuildBankEventLog::iterator itr = m_GuildBankEventLog_Money.begin(); itr != m_GuildBankEventLog_Money.end(); ++itr)
{
itr->WriteData(data, buffer);
}
}
else
{
@ -1968,7 +1984,9 @@ void Guild::DisplayGuildBankLogs(WorldSession* session, uint8 TabId)
// number of log entries
data.WriteBits(m_GuildBankEventLog_Item[TabId].size(), 23);
for (GuildBankEventLog::iterator itr = m_GuildBankEventLog_Item[TabId].begin(); itr != m_GuildBankEventLog_Item[TabId].end(); ++itr)
{
itr->WriteData(data, buffer);
}
}
if (!buffer.empty())
{

View file

@ -924,7 +924,9 @@ void Item::SetItemRandomProperties(int32 randomPropId)
SetState(ITEM_CHANGED);
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_1; i < PROP_ENCHANTMENT_SLOT_4; ++i)
{
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_1], 0, 0);
}
}
}
else
@ -941,7 +943,9 @@ void Item::SetItemRandomProperties(int32 randomPropId)
}
for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_4; ++i)
{
SetEnchantment(EnchantmentSlot(i), item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0], 0, 0);
}
}
}
}
@ -1268,7 +1272,9 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
}
for (uint8 x = 0; x < 3; ++x)
{
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot * MAX_ENCHANTMENT_OFFSET + x, 0);
}
SetState(ITEM_CHANGED);
}
@ -1277,7 +1283,9 @@ void Item::SendUpdateSockets()
WorldPacket data(SMSG_SOCKET_GEMS, 8 + 4 + 4 + 4 + 4);
data << GetObjectGuid();
for (uint32 i = SOCK_ENCHANTMENT_SLOT; i <= BONUS_ENCHANTMENT_SLOT; ++i)
{
data << uint32(GetEnchantmentId(EnchantmentSlot(i)));
}
GetOwner()->SendDirectMessage(&data);
}

View file

@ -245,7 +245,9 @@ void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const
if (!ids_set.empty())
{
for (LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr)
{
sLog.outErrorDb("Table '%s' entry %d isn't %s and not referenced from loot, and then useless.", GetName(), *itr, GetEntryName());
}
sLog.outString();
}
}

View file

@ -277,7 +277,9 @@ struct Loot
void clear()
{
for (QuestItemMap::const_iterator itr = m_playerCurrencies.begin(); itr != m_playerCurrencies.end(); ++itr)
{
delete itr->second;
}
m_playerCurrencies.clear();
for (QuestItemMap::const_iterator itr = m_playerQuestItems.begin(); itr != m_playerQuestItems.end(); ++itr)

View file

@ -125,7 +125,9 @@ ObjectAccessor::SaveAllPlayers()
HashMapHolder<Player>::ReadGuard g(HashMapHolder<Player>::GetLock());
HashMapHolder<Player>::MapType& m = sObjectAccessor.GetPlayers();
for (HashMapHolder<Player>::MapType::iterator itr = m.begin(); itr != m.end(); ++itr)
{
itr->second->SaveToDB();
}
}
void ObjectAccessor::KickPlayer(ObjectGuid guid)

View file

@ -199,7 +199,9 @@ ObjectMgr::~ObjectMgr()
{ delete itr->second; }
for (ArenaTeamMap::iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
{
delete itr->second;
}
for (CacheVendorItemMap::iterator itr = m_mCacheVendorTemplateItemMap.begin(); itr != m_mCacheVendorTemplateItemMap.end(); ++itr)
{ itr->second.Clear(); }

View file

@ -320,7 +320,9 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petentry, uint32 petnumber, bool c
Field* fields2 = result->Fetch();
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{
m_declinedname->name[i] = fields2[i].GetCppString();
}
delete result;
}
@ -900,7 +902,9 @@ void Pet::InitStatsForLevel(uint32 petlevel)
}
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
{
SetModifierValue(UnitMods(UNIT_MOD_RESISTANCE_START + i), BASE_VALUE, float(createResistance[i]));
}
float health, mana, armor, minDmg;
@ -937,7 +941,9 @@ void Pet::InitStatsForLevel(uint32 petlevel)
if (PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(1, petlevel))
{
for (int i = STAT_STRENGTH; i < MAX_STATS;++i)
{
SetCreateStat(Stats(i), float(pInfo->stats[i]));
}
health = pInfo->health;
mana = 0;
@ -955,7 +961,9 @@ void Pet::InitStatsForLevel(uint32 petlevel)
sLog.outErrorDb("HUNTER PET levelstats missing in DB! 'Weakifying' pet");
for (int i = STAT_STRENGTH; i < MAX_STATS;++i)
{
SetCreateStat(Stats(i), 1.0f);
}
health = 1;
mana = 0;
@ -1010,7 +1018,9 @@ void Pet::InitStatsForLevel(uint32 petlevel)
if (PetLevelInfo const* pInfo = sObjectMgr.GetPetLevelInfo(cInfo->Entry, petlevel))
{
for (int i = STAT_STRENGTH; i < MAX_STATS;++i)
{
SetCreateStat(Stats(i), float(pInfo->stats[i]));
}
health = pInfo->health;
mana = pInfo->mana;
@ -1045,7 +1055,9 @@ void Pet::InitStatsForLevel(uint32 petlevel)
sLog.outErrorDb("SUMMON_PET levelstats missing in DB! 'Weakifying' pet and giving it mana to make it obvious");
for (int i = STAT_STRENGTH; i < MAX_STATS;++i)
{
SetCreateStat(Stats(i), 1.0f);
}
health = 1;
mana = 1;

View file

@ -149,7 +149,9 @@ void PlayerTaxi::InitTaxiNodesForLevel(uint32 race, uint32 chrClass, uint32 leve
case CLASS_DEATH_KNIGHT:
{
for (int i = 0; i < TaxiMaskSize; ++i)
{
m_taximask[i] |= sOldContinentsNodesMask[i];
}
break;
}
}
@ -568,7 +570,9 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_
m_activeSpec = 0;
m_specsCount = 1;
for (int i = 0; i < MAX_TALENT_SPEC_COUNT; ++i)
{
m_talentsPrimaryTree[i] = 0;
}
for (int i = 0; i < BASEMOD_END; ++i)
{
@ -577,7 +581,9 @@ Player::Player(WorldSession* session): Unit(), m_mover(this), m_camera(this), m_
}
for (int i = 0; i < MAX_COMBAT_RATING; ++i)
{
m_baseRatingValue[i] = 0;
}
m_baseSpellPower = 0;
m_baseHealthRegen = 0;
@ -641,7 +647,9 @@ Player::~Player()
// clean up player-instance binds, may unload some instance saves
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); ++itr)
{
itr->second.state->RemovePlayer(this);
}
delete m_declinedname;
delete m_runes;
@ -793,7 +801,9 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
// original action bar
for (PlayerCreateInfoActions::const_iterator action_itr = info->action.begin(); action_itr != info->action.end(); ++action_itr)
{
addActionButton(0, action_itr->button, action_itr->action, action_itr->type);
}
// original items
uint32 raceClassGender = GetUInt32Value(UNIT_FIELD_BYTES_0) & 0x00FFFFFF;
@ -2375,7 +2385,9 @@ void Player::RegenerateHealth(uint32 diff)
AuraList const& mModHealthRegenPct = GetAurasByType(SPELL_AURA_MOD_HEALTH_REGEN_PERCENT);
for (AuraList::const_iterator i = mModHealthRegenPct.begin(); i != mModHealthRegenPct.end(); ++i)
{
addvalue *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
}
addvalue += GetTotalAuraModifier(SPELL_AURA_MOD_REGEN) * 2.0f / 5.0f;
}
@ -2732,14 +2744,18 @@ void Player::GiveXP(uint32 xp, Unit* victim)
// handle SPELL_AURA_MOD_KILL_XP_PCT auras
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_KILL_XP_PCT);
for (Unit::AuraList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i)
{
xp = uint32(xp * (1.0f + (*i)->GetModifier()->m_amount / 100.0f));
}
}
else
{
// handle SPELL_AURA_MOD_QUEST_XP_PCT auras
Unit::AuraList const& ModXPPctAuras = GetAurasByType(SPELL_AURA_MOD_QUEST_XP_PCT);
for (Unit::AuraList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i)
{
xp = uint32(xp * (1.0f + (*i)->GetModifier()->m_amount / 100.0f));
}
}
// XP resting bonus for kill
@ -2792,7 +2808,9 @@ void Player::GiveLevel(uint32 level)
data << uint32(0);
// end for
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i) // Stats loop (0-4)
{
data << uint32(int32(info.stats[i]) - GetCreateStat(Stats(i)));
}
GetSession()->SendPacket(&data);
@ -2809,7 +2827,9 @@ void Player::GiveLevel(uint32 level)
// save base values (bonuses already included in stored stats
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
SetCreateStat(Stats(i), info.stats[i]);
}
SetCreateHealth(basehp);
SetCreateMana(basemana);
@ -2919,10 +2939,14 @@ void Player::InitStatsForLevel(bool reapplyMods)
// save base values (bonuses already included in stored stats
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
SetCreateStat(Stats(i), info.stats[i]);
}
for (int i = STAT_STRENGTH; i < MAX_STATS; ++i)
{
SetStat(Stats(i), info.stats[i]);
}
SetCreateHealth(basehp);
@ -2935,7 +2959,9 @@ void Player::InitStatsForLevel(bool reapplyMods)
// reset rating fields values
for (uint16 index = PLAYER_FIELD_COMBAT_RATING_1; index < PLAYER_FIELD_COMBAT_RATING_1 + MAX_COMBAT_RATING; ++index)
{
SetUInt32Value(index, 0);
}
SetUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, 0);
SetFloatValue(PLAYER_FIELD_MOD_HEALING_PCT, 1.0f);
@ -2978,7 +3004,9 @@ void Player::InitStatsForLevel(bool reapplyMods)
// Init spell schools (will be recalculated in UpdateAllStats() at loading and in _ApplyAllStatBonuses() at reset
for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
{
SetFloatValue(PLAYER_SPELL_CRIT_PERCENTAGE1 + i, 0.0f);
}
SetFloatValue(PLAYER_PARRY_PERCENTAGE, 0.0f);
SetFloatValue(PLAYER_BLOCK_PERCENTAGE, 0.0f);
@ -3008,13 +3036,17 @@ void Player::InitStatsForLevel(bool reapplyMods)
}
// Reset no reagent cost field
for (int i = 0; i < 3; ++i)
{
SetUInt32Value(PLAYER_NO_REAGENT_COST_1 + i, 0);
}
// Init data for form but skip reapply item mods for form
InitDataForForm(reapplyMods);
// save new stats
for (int i = POWER_MANA; i < MAX_POWERS; ++i)
{
SetMaxPower(Powers(i), GetCreateMaxPowers(Powers(i)));
}
SetMaxHealth(basehp); // stamina bonus will applied later
@ -3783,7 +3815,9 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank, bo
SpellLearnSpellMapBounds spell_bounds = sSpellMgr.GetSpellLearnSpellMapBounds(spell_id);
for (SpellLearnSpellMap::const_iterator itr2 = spell_bounds.first; itr2 != spell_bounds.second; ++itr2)
{
removeSpell(itr2->second.spell, disabled);
}
// activate lesser rank in spellbook/action bar, and cast it if need
bool prev_activate = false;
@ -3923,7 +3957,9 @@ void Player::RemoveAllSpellCooldown()
data.WriteGuidBytes<7, 2, 4, 5, 1, 3>(guid);
for (SpellCooldowns::const_iterator itr = m_spellCooldowns.begin(); itr != m_spellCooldowns.end(); ++itr)
{
data << uint32(itr->first);
}
data.WriteGuidBytes<0, 6>(guid);
@ -4111,11 +4147,15 @@ bool Player::resetTalents(bool no_cost, bool all_specs)
{
if (std::vector<uint32> const* specSpells = GetTalentTreeMasterySpells(GetTalentTabPages(getClass())[i]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
removeSpell(specSpells->at(i), true);
}
if (std::vector<uint32> const* specSpells = GetTalentTreePrimarySpells(GetTalentTabPages(getClass())[i]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
removeSpell(specSpells->at(i), true);
}
}
for (uint8 spec = 0; spec < MAX_TALENT_SPEC_COUNT; ++spec)
@ -4298,7 +4338,9 @@ void Player::InitVisibleBits()
// PLAYER_QUEST_LOG_x also visible bit on official (but only on party/raid)...
for (uint16 i = PLAYER_QUEST_LOG_1_1; i < PLAYER_QUEST_LOG_25_2; i += MAX_QUEST_OFFSET)
{
updateVisualBits.SetBit(i);
}
// Players visible items are not inventory stuff
for (uint16 i = 0; i < EQUIPMENT_SLOT_END; ++i)
@ -5119,14 +5161,18 @@ uint32 Player::DurabilityRepairAll(bool cost, float discountMod, bool guildBank)
uint32 TotalCost = 0;
// equipped, backpack, bags itself
for (int i = EQUIPMENT_SLOT_START; i < INVENTORY_SLOT_ITEM_END; ++i)
{
TotalCost += DurabilityRepair(((INVENTORY_SLOT_BAG_0 << 8) | i), cost, discountMod, guildBank);
}
// bank, buyback and keys not repaired
// items in inventory bags
for (int j = INVENTORY_SLOT_BAG_START; j < INVENTORY_SLOT_BAG_END; ++j)
for (int i = 0; i < MAX_BAG_SIZE; ++i)
{
TotalCost += DurabilityRepair(((j << 8) | i), cost, discountMod, guildBank);
}
return TotalCost;
}
@ -5742,7 +5788,9 @@ void Player::UpdateRating(CombatRating cr)
void Player::UpdateAllRatings()
{
for (int cr = 0; cr < MAX_COMBAT_RATING; ++cr)
{
UpdateRating(CombatRating(cr));
}
}
void Player::SetRegularAttackTime()
@ -7484,7 +7532,9 @@ void Player::DuelComplete(DuelCompleteType type)
}
for (size_t i = 0; i < auras2remove.size(); ++i)
{
duel->opponent->RemoveAurasDueToSpell(auras2remove[i]);
}
auras2remove.clear();
SpellAuraHolderMap const& auras = GetSpellAuraHolderMap();
@ -7494,7 +7544,9 @@ void Player::DuelComplete(DuelCompleteType type)
auras2remove.push_back(i->second->GetId());
}
for (size_t i = 0; i < auras2remove.size(); ++i)
{
RemoveAurasDueToSpell(auras2remove[i]);
}
// cleanup combo points
if (GetComboTargetGuid() == duel->opponent->GetObjectGuid())
@ -7808,15 +7860,21 @@ void Player::_ApplyWeaponDependentAuraMods(Item* item, WeaponAttackType attackTy
{
AuraList const& auraCritList = GetAurasByType(SPELL_AURA_MOD_CRIT_PERCENT);
for (AuraList::const_iterator itr = auraCritList.begin(); itr != auraCritList.end(); ++itr)
{
_ApplyWeaponDependentAuraCritMod(item, attackType, *itr, apply);
}
AuraList const& auraDamageFlatList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_DONE);
for (AuraList::const_iterator itr = auraDamageFlatList.begin(); itr != auraDamageFlatList.end(); ++itr)
{
_ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
}
AuraList const& auraDamagePCTList = GetAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
for (AuraList::const_iterator itr = auraDamagePCTList.begin(); itr != auraDamagePCTList.end(); ++itr)
{
_ApplyWeaponDependentAuraDamageMod(item, attackType, *itr, apply);
}
}
void Player::_ApplyWeaponDependentAuraCritMod(Item* item, WeaponAttackType attackType, Aura* aura, bool apply)
@ -11382,7 +11440,9 @@ Item* Player::StoreNewItem(ItemPosCountVec const& dest, uint32 item, bool update
{
uint32 count = 0;
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
{
count += itr->count;
}
Item* pItem = Item::CreateItem(item, count, this, randomPropertyId);
if (pItem)
@ -11868,7 +11928,9 @@ void Player::DestroyItem(uint8 bag, uint8 slot, bool update)
if (pItem->IsBag() && pItem->IsEquipped()) // this also prevent infinity loop if empty bag stored in bag==slot
{
for (int i = 0; i < MAX_BAG_SIZE; ++i)
{
DestroyItem(slot, i, update);
}
}
if (pItem->HasFlag(ITEM_FIELD_FLAGS, ITEM_DYNFLAG_WRAPPED))
@ -12920,7 +12982,9 @@ void Player::AddEnchantmentDuration(Item* item, EnchantmentSlot slot, uint32 dur
void Player::ApplyEnchantment(Item* item, bool apply)
{
for (uint32 slot = 0; slot < MAX_ENCHANTMENT_SLOT; ++slot)
{
ApplyEnchantment(item, EnchantmentSlot(slot), apply);
}
}
void Player::ApplyEnchantment(Item* item, EnchantmentSlot slot, bool apply, bool apply_dur, bool ignore_condition)
@ -14508,13 +14572,17 @@ void Player::AddQuest(Quest const* pQuest, Object* questGiver)
if (pQuest->HasSpecialFlag(QUEST_SPECIAL_FLAG_DELIVER))
{
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
{
questStatusData.m_itemcount[i] = 0;
}
}
if (pQuest->HasSpecialFlag(QuestSpecialFlags(QUEST_SPECIAL_FLAG_KILL_OR_CAST | QUEST_SPECIAL_FLAG_SPEAKTO)))
{
for (int i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
{
questStatusData.m_creatureOrGOcount[i] = 0;
}
}
if (pQuest->GetRepObjectiveFaction())
@ -14596,16 +14664,22 @@ void Player::AddQuest(Quest const* pQuest, Object* questGiver)
GetZoneAndAreaId(zone, area);
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(zone);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, true);
}
if (area != zone)
{
saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(area);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, true);
}
}
saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(0);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, true);
}
UpdateForQuestWorldObjects();
}
@ -14808,16 +14882,22 @@ void Player::RewardQuest(Quest const* pQuest, uint32 reward, Object* questGiver,
GetZoneAndAreaId(zone, area);
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(zone);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, false);
}
if (area != zone)
{
saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(area);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, false);
}
}
saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(0);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, zone, area, false);
}
// resend quests status directly
SendQuestGiverStatusMultiple();
@ -15336,7 +15416,9 @@ void Player::GiveQuestSourceItemIfNeed(Quest const* pQuest)
{
uint32 count = 0;
for (ItemPosCountVec::const_iterator c_itr = dest.begin(); c_itr != dest.end(); ++c_itr)
{
count += c_itr->count;
}
Item* item = StoreNewItem(dest, pQuest->GetSrcItemId(), true);
SendNewItem(item, count, true, false);
@ -16253,7 +16335,9 @@ void Player::_LoadDeclinedNames(QueryResult* result)
Field* fields = result->Fetch();
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
{
m_declinedname->name[i] = fields[i].GetCppString();
}
delete result;
}
@ -16320,7 +16404,9 @@ void Player::_LoadEquipmentSets(QueryResult* result)
eqSet.state = EQUIPMENT_SET_UNCHANGED;
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
eqSet.Items[i] = fields[5 + i].GetUInt32();
}
m_EquipmentSets[index] = eqSet;
@ -16545,7 +16631,9 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
// arena team not exist or not member, cleanup fields
for (int j = 0; j < ARENA_TEAM_END; ++j)
{
SetArenaTeamInfoField(arena_slot, ArenaTeamInfoType(j), 0);
}
}
SetUInt32Value(PLAYER_FIELD_LIFETIME_HONORBALE_KILLS, fields[40].GetUInt32());
@ -16871,7 +16959,9 @@ bool Player::LoadFromDB(ObjectGuid guid, SqlQueryHolder* holder)
{
m_taxi.ClearTaxiDestinations();
for (int i = 0; i < 2; ++i)
{
m_taxi.AddTaxiDestination(m_bgData.taxiPath[i]);
}
}
else if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes, GetTeam()))
{
@ -17088,7 +17178,9 @@ bool Player::isAllowedToLoot(Creature* creature)
void Player::_LoadActions(QueryResult* result)
{
for (int i = 0; i < MAX_TALENT_SPEC_COUNT; ++i)
{
m_actionButtons[i].clear();
}
// QueryResult *result = CharacterDatabase.PQuery("SELECT spec, button,action,type FROM character_action WHERE guid = '%u' ORDER BY button",GetGUIDLow());
@ -17704,13 +17796,17 @@ void Player::_LoadQuestStatus(QueryResult* result)
// clear quest log tail
for (uint16 i = slot; i < MAX_QUEST_LOG_SIZE; ++i)
{
SetQuestSlot(i, 0);
}
}
void Player::_LoadDailyQuestStatus(QueryResult* result)
{
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
{
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx, 0);
}
// QueryResult *result = CharacterDatabase.PQuery("SELECT quest FROM character_queststatus_daily WHERE guid = '%u'", GetGUIDLow());
@ -17938,7 +18034,9 @@ void Player::_LoadGroup(QueryResult* result)
void Player::_LoadBoundInstances(QueryResult* result)
{
for (uint8 i = 0; i < MAX_DIFFICULTY; ++i)
{
m_boundInstances[i].clear();
}
Group* group = GetGroup();
@ -18399,7 +18497,9 @@ void Player::SaveToDB()
uberInsert.addUInt64(uint64(m_resetTalentsTime));
ss.str("");
for (int i = 0; i < MAX_TALENT_SPEC_COUNT; ++i)
{
ss << m_talentsPrimaryTree[i] << " ";
}
uberInsert.addString(ss);
uberInsert.addFloat(finiteAlways(m_movementInfo.GetTransportPos()->x));
@ -18440,7 +18540,9 @@ void Player::SaveToDB()
uberInsert.addUInt32(GetHealth());
for (uint32 i = 0; i < MAX_STORED_POWERS; ++i)
{
uberInsert.addUInt32(GetPowerByIndex(i));
}
uberInsert.addUInt32(uint32(m_specsCount));
uberInsert.addUInt32(uint32(m_activeSpec));
@ -18635,10 +18737,14 @@ void Player::_SaveAuras()
stmt.addUInt8(holder->GetAuraCharges());
for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
stmt.addInt32(damage[i]);
}
for (uint32 i = 0; i < MAX_EFFECT_INDEX; ++i)
{
stmt.addUInt32(periodicTime[i]);
}
stmt.addInt32(holder->GetAuraMaxDuration());
stmt.addInt32(holder->GetAuraDuration());
@ -18823,7 +18929,9 @@ void Player::_SaveMail()
stmt = CharacterDatabase.CreateStatement(deleteMailItems, "DELETE FROM mail_items WHERE item_guid = ?");
for (std::vector<uint32>::const_iterator itr2 = m->removedItems.begin(); itr2 != m->removedItems.end(); ++itr2)
{
stmt.PExecute(*itr2);
}
m->removedItems.clear();
}
@ -18835,7 +18943,9 @@ void Player::_SaveMail()
{
SqlStatement stmt = CharacterDatabase.CreateStatement(deleteItem, "DELETE FROM item_instance WHERE guid = ?");
for (MailItemInfoVec::const_iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
{
stmt.PExecute(itr2->item_guid);
}
}
SqlStatement stmt = CharacterDatabase.CreateStatement(deleteMain, "DELETE FROM mail WHERE id = ?");
@ -18886,9 +18996,13 @@ void Player::_SaveQuestStatus()
stmt.addUInt8(i->second.m_explored);
stmt.addUInt64(uint64(i->second.m_timer / IN_MILLISECONDS + sWorld.GetGameTime()));
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
{
stmt.addUInt32(i->second.m_creatureOrGOcount[k]);
}
for (int k = 0; k < QUEST_ITEM_OBJECTIVES_COUNT; ++k)
{
stmt.addUInt32(i->second.m_itemcount[k]);
}
stmt.Execute();
}
break;
@ -18902,9 +19016,13 @@ void Player::_SaveQuestStatus()
stmt.addUInt8(i->second.m_explored);
stmt.addUInt64(uint64(i->second.m_timer / IN_MILLISECONDS + sWorld.GetGameTime()));
for (int k = 0; k < QUEST_OBJECTIVES_COUNT; ++k)
{
stmt.addUInt32(i->second.m_creatureOrGOcount[k]);
}
for (int k = 0; k < QUEST_ITEM_OBJECTIVES_COUNT; ++k)
{
stmt.addUInt32(i->second.m_itemcount[k]);
}
stmt.addUInt32(GetGUIDLow());
stmt.addUInt32(i->first);
stmt.Execute();
@ -19130,7 +19248,9 @@ void Player::_SaveStats()
stmt.addUInt32(GetGUIDLow());
stmt.addUInt32(GetMaxHealth());
for (uint32 i = 0; i < MAX_STORED_POWERS; ++i)
{
stmt.addUInt32(GetMaxPowerByIndex(i));
}
for (int i = 0; i < MAX_STATS; ++i)
{ stmt.addFloat(GetStat(Stats(i))); }
// armor + school resistances
@ -21888,7 +22008,9 @@ void Player::SendAurasForTarget(Unit* target)
data << target->GetPackGUID();
for (Unit::VisibleAuraMap::const_iterator itr = visibleAuras.begin(); itr != visibleAuras.end(); ++itr)
{
itr->second->BuildUpdatePacket(data);
}
GetSession()->SendPacket(&data);
}
@ -21921,7 +22043,9 @@ void Player::SetMonthlyQuestStatus(uint32 quest_id)
void Player::ResetDailyQuestStatus()
{
for (uint32 quest_daily_idx = 0; quest_daily_idx < PLAYER_MAX_DAILY_QUESTS; ++quest_daily_idx)
{
SetUInt32Value(PLAYER_FIELD_DAILY_QUESTS_1 + quest_daily_idx, 0);
}
// DB data deleted in caller
m_DailyQuestChanged = false;
@ -22576,7 +22700,9 @@ void Player::UpdateZoneDependentAuras()
// Some spells applied at enter into zone (with subzones), aura removed in UpdateAreaDependentAuras that called always at zone->area update
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(m_zoneUpdateId);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, m_zoneUpdateId, 0, true);
}
}
void Player::UpdateAreaDependentAuras()
@ -22597,7 +22723,9 @@ void Player::UpdateAreaDependentAuras()
// some auras applied at subzone enter
SpellAreaForAreaMapBounds saBounds = sSpellMgr.GetSpellAreaForAreaMapBounds(m_areaUpdateId);
for (SpellAreaForAreaMap::const_iterator itr = saBounds.first; itr != saBounds.second; ++itr)
{
itr->second->ApplyOrRemoveSpellIfCan(this, m_zoneUpdateId, m_areaUpdateId, true);
}
}
struct UpdateZoneDependentPetsHelper
@ -23069,7 +23197,9 @@ void Player::ApplyGlyph(uint8 slot, bool apply)
void Player::ApplyGlyphs(bool apply)
{
for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
{
ApplyGlyph(i, apply);
}
}
bool Player::isTotalImmune()
@ -23189,7 +23319,9 @@ void Player::UpdateRuneRegen(RuneType rune)
void Player::UpdateRuneRegen()
{
for (uint8 i = 0; i < NUM_RUNE_TYPES; ++i)
{
UpdateRuneRegen(RuneType(i));
}
}
uint8 Player::GetRuneCooldownFraction(uint8 index) const
@ -23326,7 +23458,9 @@ void Player::InitRunes()
}
for (uint32 i = 0; i < NUM_RUNE_TYPES; ++i)
{
SetFloatValue(PLAYER_RUNE_REGEN_1 + i, 0.1f);
}
}
bool Player::IsBaseRuneSlotsOnCooldown(RuneType runeType) const
@ -23961,11 +24095,15 @@ bool Player::LearnTalent(uint32 talentId, uint32 talentRank)
m_talentsPrimaryTree[m_activeSpec] = talentInfo->TalentTab;
if (std::vector<uint32> const* specSpells = GetTalentTreeMasterySpells(talentInfo->TalentTab))
for (size_t i = 0; i < specSpells->size(); ++i)
{
learnSpell(specSpells->at(i), false);
}
if (std::vector<uint32> const* specSpells = GetTalentTreePrimarySpells(talentInfo->TalentTab))
for (size_t i = 0; i < specSpells->size(); ++i)
{
learnSpell(specSpells->at(i), false);
}
// Update talent tree role-dependent mana regen
UpdateManaRegen();
@ -24261,7 +24399,9 @@ void Player::BuildPlayerTalentsInfoData(WorldPacket* data)
// GlyphProperties.dbc
for (uint8 i = 0; i < MAX_GLYPH_SLOT_INDEX; ++i)
{
*data << uint16(m_glyphs[specIdx][i].GetId());
}
}
}
}
@ -24494,7 +24634,9 @@ void Player::_SaveEquipmentSets()
stmt.addUInt32(eqset.IgnoreMask);
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
stmt.addUInt32(eqset.Items[i]);
}
stmt.addUInt32(GetGUIDLow());
stmt.addUInt64(eqset.Guid);
@ -24517,7 +24659,9 @@ void Player::_SaveEquipmentSets()
stmt.addUInt32(eqset.IgnoreMask);
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
stmt.addUInt32(eqset.Items[i]);
}
stmt.Execute();
@ -24610,11 +24754,15 @@ void Player::ActivateSpec(uint8 specNum)
{
if (std::vector<uint32> const* specSpells = GetTalentTreeMasterySpells(GetTalentTabPages(getClass())[i]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
removeSpell(specSpells->at(i), true);
}
if (std::vector<uint32> const* specSpells = GetTalentTreePrimarySpells(GetTalentTabPages(getClass())[i]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
removeSpell(specSpells->at(i), true);
}
}
ApplyGlyphs(false);
@ -24721,11 +24869,15 @@ void Player::ActivateSpec(uint8 specNum)
if (std::vector<uint32> const* specSpells = GetTalentTreeMasterySpells(m_talentsPrimaryTree[m_activeSpec]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
learnSpell(specSpells->at(i), false);
}
if (std::vector<uint32> const* specSpells = GetTalentTreePrimarySpells(m_talentsPrimaryTree[m_activeSpec]))
for (size_t i = 0; i < specSpells->size(); ++i)
{
learnSpell(specSpells->at(i), false);
}
ApplyGlyphs(true);
@ -24769,7 +24921,9 @@ void Player::UpdateSpecCount(uint8 count)
if (itr->second.uState != ACTIONBUTTON_DELETED)
{
for (uint8 spec = curCount; spec < count; ++spec)
{
addActionButton(spec, itr->first, itr->second.GetAction(), itr->second.GetType());
}
}
}
}
@ -24781,7 +24935,9 @@ void Player::UpdateSpecCount(uint8 count)
{
// delete action buttons for removed spec
for (uint8 button = 0; button < MAX_ACTION_BUTTONS; ++button)
{
removeActionButton(spec, button);
}
}
}
@ -25485,7 +25641,9 @@ void Player::SendRatedBGStats()
WorldPacket data(SMSG_RATED_BG_STATS, 18 * 4);
for (int i = 0; i < 18; ++i)
{
data << uint32(0);
}
SendDirectMessage(&data);
}

View file

@ -708,7 +708,9 @@ struct EquipmentSet
EquipmentSet() : Guid(0), IgnoreMask(0), state(EQUIPMENT_SET_NEW)
{
for (int i = 0; i < EQUIPMENT_SLOT_END; ++i)
{
Items[i] = 0;
}
}
uint64 Guid;

View file

@ -302,7 +302,9 @@ uint32 GetSpellCastTimeForBonus(SpellEntry const* spellProto, DamageEffectType d
// -5% of total per any additional effect (multiplicative)
for (int i = 0; i < effects; ++i)
{
CastingTime *= 0.95f;
}
return CastingTime;
}
@ -4120,7 +4122,9 @@ void SpellMgr::LoadPetDefaultSpells()
int32 petSpellsId = -(int32)cInfo->PetSpellDataId;
PetDefaultSpellsEntry petDefSpells;
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
{
petDefSpells.spellid[j] = spellDataEntry->spellId[j];
}
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
{
@ -4161,7 +4165,9 @@ void SpellMgr::LoadPetDefaultSpells()
PetDefaultSpellsEntry petDefSpells;
if (CreatureTemplateSpells const* templateSpells = sCreatureTemplateSpellsStorage.LookupEntry<CreatureTemplateSpells>(cInfo->Entry))
for (int j = 0; j < MAX_CREATURE_SPELL_DATA_SLOT; ++j)
{
petDefSpells.spellid[j] = templateSpells->spells[j];
}
if (LoadPetDefaultSpells_helper(cInfo, petDefSpells))
{

View file

@ -107,7 +107,9 @@ void Player::ApplySpellPowerBonus(int32 amount, bool apply)
// For speed just update for client
ApplyModUInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, amount, apply);
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
{
ApplyModUInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, amount, apply);;
}
}
void Player::UpdateSpellDamageAndHealingBonus()
@ -118,7 +120,9 @@ void Player::UpdateSpellDamageAndHealingBonus()
SetStatInt32Value(PLAYER_FIELD_MOD_HEALING_DONE_POS, SpellBaseHealingBonusDone(SPELL_SCHOOL_MASK_ALL));
// Get damage bonus for all schools
for (int i = SPELL_SCHOOL_HOLY; i < MAX_SPELL_SCHOOL; ++i)
{
SetStatInt32Value(PLAYER_FIELD_MOD_DAMAGE_DONE_POS + i, SpellBaseDamageBonusDone(SpellSchoolMask(1 << i)));
}
SetStatFloatValue(PLAYER_FIELD_OVERRIDE_SPELL_POWER_BY_AP_PCT, GetTotalAuraModifier(SPELL_AURA_OVERRIDE_SPELL_POWER_BY_AP_PCT));
}

View file

@ -4402,7 +4402,9 @@ int32 Unit::GetTotalAuraModifier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for (AuraList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
modifier += (*i)->GetModifier()->m_amount;
}
return modifier;
}
@ -4413,7 +4415,9 @@ float Unit::GetTotalAuraMultiplier(AuraType auratype) const
AuraList const& mTotalAuraList = GetAurasByType(auratype);
for (AuraList::const_iterator i = mTotalAuraList.begin(); i != mTotalAuraList.end(); ++i)
{
multiplier *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
}
return multiplier;
}
@ -8059,7 +8063,9 @@ uint32 Unit::SpellHealingBonusDone(Unit* pVictim, SpellEntry const* spellProto,
// Healing done percent
AuraList const& mHealingDonePct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_PERCENT);
for (AuraList::const_iterator i = mHealingDonePct.begin(); i != mHealingDonePct.end(); ++i)
{
DoneTotalMod *= (100.0f + (*i)->GetModifier()->m_amount) / 100.0f;
}
AuraList const& mHealingFromHealthPct = GetAurasByType(SPELL_AURA_MOD_HEALING_DONE_FROM_PCT_HEALTH);
if (!mHealingFromHealthPct.empty())
@ -11348,28 +11354,38 @@ CharmInfo::CharmInfo(Unit* unit)
: m_unit(unit), m_CommandState(COMMAND_FOLLOW), m_reactState(REACT_PASSIVE), m_petnumber(0)
{
for (int i = 0; i < CREATURE_MAX_SPELLS; ++i)
{
m_charmspells[i].SetActionAndType(0, ACT_DISABLED);
}
}
void CharmInfo::InitPetActionBar()
{
// the first 3 SpellOrActions are attack, follow and stay
for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_START - ACTION_BAR_INDEX_START; ++i)
{
SetActionBar(ACTION_BAR_INDEX_START + i, COMMAND_ATTACK - i, ACT_COMMAND);
}
// middle 4 SpellOrActions are spells/special attacks/abilities
for (uint32 i = 0; i < ACTION_BAR_INDEX_PET_SPELL_END - ACTION_BAR_INDEX_PET_SPELL_START; ++i)
{
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_START + i, 0, ACT_DISABLED);
}
// last 3 SpellOrActions are reactions
for (uint32 i = 0; i < ACTION_BAR_INDEX_END - ACTION_BAR_INDEX_PET_SPELL_END; ++i)
{
SetActionBar(ACTION_BAR_INDEX_PET_SPELL_END + i, COMMAND_ATTACK - i, ACT_REACTION);
}
}
void CharmInfo::InitEmptyActionBar()
{
for (uint32 x = ACTION_BAR_INDEX_START; x < ACTION_BAR_INDEX_END; ++x)
{
SetActionBar(x, 0, ACT_PASSIVE);
}
}
void CharmInfo::InitVehicleCreateSpells()
@ -11560,7 +11576,9 @@ void CharmInfo::LoadPetActionBar(const std::string& data)
void CharmInfo::BuildActionBar(WorldPacket* data)
{
for (uint32 i = 0; i < MAX_UNIT_ACTION_BAR_INDEX; ++i)
{
*data << uint32(PetActionBar[i].packedData);
}
}
void CharmInfo::SetSpellAutocast(uint32 spell_id, bool state)
@ -11810,7 +11828,9 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit* pTarget, uint32 procFlag,
removedSpells.unique();
// Remove auras from removedAuras
for (RemoveSpellList::const_iterator i = removedSpells.begin(); i != removedSpells.end(); ++i)
{
RemoveAurasDueToSpell(*i);
}
}
}
@ -12134,7 +12154,9 @@ void Unit::ClearComboPointHolders()
void Unit::ClearAllReactives()
{
for (int i = 0; i < MAX_REACTIVE; ++i)
{
m_reactiveTimer[i] = 0;
}
if (HasAuraState(AURA_STATE_DEFENSE))
ModifyAuraState(AURA_STATE_DEFENSE, false);
@ -12218,7 +12240,9 @@ Unit* Unit::SelectRandomUnfriendlyTarget(Unit* except /*= NULL*/, float radius /
uint32 rIdx = urand(0, targets.size() - 1);
std::list<Unit*>::const_iterator tcIter = targets.begin();
for (uint32 i = 0; i < rIdx; ++i)
{
++tcIter;
}
return *tcIter;
}
@ -12259,7 +12283,9 @@ Unit* Unit::SelectRandomFriendlyTarget(Unit* except /*= NULL*/, float radius /*=
uint32 rIdx = urand(0, targets.size() - 1);
std::list<Unit*>::const_iterator tcIter = targets.begin();
for (uint32 i = 0; i < rIdx; ++i)
{
++tcIter;
}
return *tcIter;
}
@ -12722,12 +12748,16 @@ bool Unit::IsIgnoreUnitState(SpellEntry const* spell, IgnoreUnitState ignoreStat
void Unit::CleanupDeletedAuras()
{
for (SpellAuraHolderList::const_iterator iter = m_deletedHolders.begin(); iter != m_deletedHolders.end(); ++iter)
{
delete *iter;
}
m_deletedHolders.clear();
// really delete auras "deleted" while processing its ApplyModify code
for (AuraList::const_iterator itr = m_deletedAuras.begin(); itr != m_deletedAuras.end(); ++itr)
{
delete *itr;
}
m_deletedAuras.clear();
}

View file

@ -88,14 +88,18 @@ class UpdateMask
{
MANGOS_ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
{
mUpdateMask[i] &= mask.mUpdateMask[i];
}
}
void operator |= (const UpdateMask& mask)
{
MANGOS_ASSERT(mask.mCount <= mCount);
for (uint32 i = 0; i < mBlocks; ++i)
{
mUpdateMask[i] |= mask.mUpdateMask[i];
}
}
UpdateMask operator & (const UpdateMask& mask) const

View file

@ -527,7 +527,9 @@ uint8 VehicleInfo::GetTakenSeatsMask() const
uint8 takenSeatsMask = 0;
for (PassengerMap::const_iterator itr = m_passengers.begin(); itr != m_passengers.end(); ++itr)
{
takenSeatsMask |= 1 << itr->second->GetTransportSeat();
}
return takenSeatsMask;
}