*Massive cleanup redux.
--HG-- branch : trunk
This commit is contained in:
+28
-32
@@ -39,7 +39,6 @@
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAB.h"
|
||||
|
||||
|
||||
INSTANTIATE_SINGLETON_1(AchievementGlobalMgr);
|
||||
|
||||
namespace MaNGOS
|
||||
@@ -72,7 +71,6 @@ namespace MaNGOS
|
||||
};
|
||||
} // namespace MaNGOS
|
||||
|
||||
|
||||
bool AchievementCriteriaData::IsValid(AchievementCriteriaEntry const* criteria)
|
||||
{
|
||||
if(dataType >= MAX_ACHIEVEMENT_CRITERIA_DATA_TYPE)
|
||||
@@ -320,7 +318,7 @@ bool AchievementCriteriaData::Meets(Player const* source, Unit const* target, ui
|
||||
|
||||
bool AchievementCriteriaDataSet::Meets(Player const* source, Unit const* target, uint32 miscvalue /*= 0*/) const
|
||||
{
|
||||
for(Storage::const_iterator itr = storage.begin(); itr != storage.end(); ++itr)
|
||||
for (Storage::const_iterator itr = storage.begin(); itr != storage.end(); ++itr)
|
||||
if(!itr->Meets(source,target,miscvalue))
|
||||
return false;
|
||||
|
||||
@@ -338,14 +336,14 @@ AchievementMgr::~AchievementMgr()
|
||||
|
||||
void AchievementMgr::Reset()
|
||||
{
|
||||
for(CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
WorldPacket data(SMSG_ACHIEVEMENT_DELETED,4);
|
||||
data << uint32(iter->first);
|
||||
m_player->SendDirectMessage(&data);
|
||||
}
|
||||
|
||||
for(CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
WorldPacket data(SMSG_CRITERIA_DELETED,4);
|
||||
data << uint32(iter->first);
|
||||
@@ -369,7 +367,7 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
|
||||
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const *achievementCriteria = (*i);
|
||||
|
||||
@@ -415,7 +413,7 @@ void AchievementMgr::SaveToDB()
|
||||
bool need_execute = false;
|
||||
std::ostringstream ssdel;
|
||||
std::ostringstream ssins;
|
||||
for(CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
if(!iter->second.changed)
|
||||
continue;
|
||||
@@ -459,7 +457,7 @@ void AchievementMgr::SaveToDB()
|
||||
bool need_execute_ins = false;
|
||||
std::ostringstream ssdel;
|
||||
std::ostringstream ssins;
|
||||
for(CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
if(!iter->second.changed)
|
||||
continue;
|
||||
@@ -640,7 +638,7 @@ void AchievementMgr::SendCriteriaUpdate(uint32 id, CriteriaProgress const* progr
|
||||
void AchievementMgr::CheckAllAchievementCriteria()
|
||||
{
|
||||
// suppress sending packets
|
||||
for(uint32 i=0; i<ACHIEVEMENT_CRITERIA_TYPE_TOTAL; ++i)
|
||||
for (uint32 i=0; i<ACHIEVEMENT_CRITERIA_TYPE_TOTAL; ++i)
|
||||
UpdateAchievementCriteria(AchievementCriteriaTypes(i));
|
||||
}
|
||||
|
||||
@@ -668,7 +666,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = achievementmgr.GetAchievementCriteriaByType(type);
|
||||
for(AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
for (AchievementCriteriaEntryList::const_iterator i = achievementCriteriaList.begin(); i!=achievementCriteriaList.end(); ++i)
|
||||
{
|
||||
AchievementCriteriaEntry const *achievementCriteria = (*i);
|
||||
|
||||
@@ -820,7 +818,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_COMPLETE_QUEST_COUNT:
|
||||
{
|
||||
uint32 counter =0;
|
||||
for(QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
|
||||
if(itr->second.m_rewarded)
|
||||
counter++;
|
||||
SetCriteriaProgress(achievementCriteria, counter);
|
||||
@@ -833,7 +831,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
|
||||
uint32 counter =0;
|
||||
for(QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
|
||||
for (QuestStatusMap::const_iterator itr = GetPlayer()->getQuestStatusMap().begin(); itr!=GetPlayer()->getQuestStatusMap().end(); itr++)
|
||||
{
|
||||
Quest const* quest = objmgr.GetQuestTemplate(itr->first);
|
||||
if(itr->second.m_rewarded && quest->GetZoneOrSort() >= 0 && uint32(quest->GetZoneOrSort()) == achievementCriteria->complete_quests_in_zone.zoneID)
|
||||
@@ -865,7 +863,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
continue;
|
||||
// skip wrong arena achievements, if not achievIdByArenaSlot then normal total death counter
|
||||
bool notfit = false;
|
||||
for(int j = 0; j < MAX_ARENA_SLOT; ++j)
|
||||
for (int j = 0; j < MAX_ARENA_SLOT; ++j)
|
||||
{
|
||||
if(achievIdByArenaSlot[j] == achievement->ID)
|
||||
{
|
||||
@@ -894,7 +892,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
|
||||
// search case
|
||||
bool found = false;
|
||||
for(int j = 0; achievIdForDangeon[j][0]; ++j)
|
||||
for (int j = 0; achievIdForDangeon[j][0]; ++j)
|
||||
{
|
||||
if(achievIdForDangeon[j][0] == achievement->ID)
|
||||
{
|
||||
@@ -1008,7 +1006,6 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
SetCriteriaProgress(achievementCriteria, 1);
|
||||
break;
|
||||
}
|
||||
@@ -1257,7 +1254,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
++spellIter)
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
{
|
||||
if(skillIter->second->skillId == achievementCriteria->learn_skillline_spell.skillLine)
|
||||
spellCount++;
|
||||
@@ -1304,7 +1301,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
++spellIter)
|
||||
{
|
||||
SkillLineAbilityMapBounds bounds = spellmgr.GetSkillLineAbilityMapBounds(spellIter->first);
|
||||
for(SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
for (SkillLineAbilityMap::const_iterator skillIter = bounds.first; skillIter != bounds.second; ++skillIter)
|
||||
if (skillIter->second->skillId == achievementCriteria->learn_skill_line.skillLine)
|
||||
spellCount++;
|
||||
}
|
||||
@@ -1375,7 +1372,7 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
|
||||
if(AchievementEntryList const* achRefList = achievementmgr.GetAchievementByReferencedId(achievement->ID))
|
||||
{
|
||||
for(AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
|
||||
for (AchievementEntryList::const_iterator itr = achRefList->begin(); itr != achRefList->end(); ++itr)
|
||||
if(IsCompletedAchievement(*itr))
|
||||
CompletedAchievement(*itr);
|
||||
}
|
||||
@@ -1413,12 +1410,12 @@ bool AchievementMgr::IsCompletedCriteria(AchievementCriteriaEntry const* achieve
|
||||
case ACHIEVEMENT_CRITERIA_TYPE_REACH_LEVEL:
|
||||
{
|
||||
// skip wrong class achievements
|
||||
for(int i = 1; i < MAX_CLASSES; ++i)
|
||||
for (int i = 1; i < MAX_CLASSES; ++i)
|
||||
if(achievIdByClass[i] == achievement->ID && i != GetPlayer()->getClass())
|
||||
return false;
|
||||
|
||||
// skip wrong race achievements
|
||||
for(int i = 1; i < MAX_RACES; ++i)
|
||||
for (int i = 1; i < MAX_RACES; ++i)
|
||||
if(achievIdByRace[i] == achievement->ID && i != GetPlayer()->getRace())
|
||||
return false;
|
||||
|
||||
@@ -1564,7 +1561,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
|
||||
// Oddly, the target count is NOT countained in the achievement, but in each individual criteria
|
||||
if (entry->flags & ACHIEVEMENT_FLAG_SUMM)
|
||||
{
|
||||
for(AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
|
||||
for (AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
|
||||
{
|
||||
AchievementCriteriaEntry const* criteria = *itr;
|
||||
|
||||
@@ -1584,7 +1581,7 @@ bool AchievementMgr::IsCompletedAchievement(AchievementEntry const* entry)
|
||||
|
||||
// Default case - need complete all or
|
||||
bool completed_all = true;
|
||||
for(AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
|
||||
for (AchievementCriteriaEntryList::const_iterator itr = cList->begin(); itr != cList->end(); ++itr)
|
||||
{
|
||||
AchievementCriteriaEntry const* criteria = *itr;
|
||||
|
||||
@@ -1676,7 +1673,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
|
||||
if(!sWorld.getConfig(CONFIG_GM_ALLOW_ACHIEVEMENT_GAINS) && m_player->GetSession()->GetSecurity() > SEC_PLAYER)
|
||||
return;
|
||||
|
||||
|
||||
if(achievement->flags & ACHIEVEMENT_FLAG_COUNTER || m_completedAchievements.find(achievement->ID)!=m_completedAchievements.end())
|
||||
return;
|
||||
|
||||
@@ -1755,7 +1752,7 @@ void AchievementMgr::SendAllAchievementData()
|
||||
else
|
||||
data.resize( 0x7fff );
|
||||
// More than this causes client trouble
|
||||
|
||||
|
||||
CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin();
|
||||
CriteriaProgressMap::const_iterator iter2 = m_criteriaProgress.begin();
|
||||
|
||||
@@ -1765,10 +1762,10 @@ void AchievementMgr::SendAllAchievementData()
|
||||
{
|
||||
data.clear();
|
||||
send = false;
|
||||
|
||||
|
||||
if( !cAchievements )
|
||||
{
|
||||
for(; iter != m_completedAchievements.end() && !send; ++iter)
|
||||
for (; iter != m_completedAchievements.end() && !send; ++iter)
|
||||
{
|
||||
data << uint32(iter->first);
|
||||
data << uint32(secsToTimeBitFields(iter->second.date));
|
||||
@@ -1780,7 +1777,7 @@ void AchievementMgr::SendAllAchievementData()
|
||||
}
|
||||
|
||||
data << int32(-1);
|
||||
for(; iter2 != m_criteriaProgress.end() && !send; ++iter2)
|
||||
for (; iter2 != m_criteriaProgress.end() && !send; ++iter2)
|
||||
{
|
||||
data << uint32(iter2->first);
|
||||
data.appendPackGUID(iter2->second.counter);
|
||||
@@ -1791,7 +1788,7 @@ void AchievementMgr::SendAllAchievementData()
|
||||
data << uint32(0);
|
||||
send = data.size() > 0x7f00;
|
||||
}
|
||||
|
||||
|
||||
if( iter2 == m_criteriaProgress.end() )
|
||||
cProgress = true;
|
||||
|
||||
@@ -1814,14 +1811,14 @@ void AchievementMgr::SendRespondInspectAchievements(Player* player)
|
||||
*/
|
||||
void AchievementMgr::BuildAllDataPacket(WorldPacket *data)
|
||||
{
|
||||
for(CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
for (CompletedAchievementMap::const_iterator iter = m_completedAchievements.begin(); iter!=m_completedAchievements.end(); ++iter)
|
||||
{
|
||||
*data << uint32(iter->first);
|
||||
*data << uint32(secsToTimeBitFields(iter->second.date));
|
||||
}
|
||||
*data << int32(-1);
|
||||
|
||||
for(CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
for (CriteriaProgressMap::const_iterator iter = m_criteriaProgress.begin(); iter!=m_criteriaProgress.end(); ++iter)
|
||||
{
|
||||
*data << uint32(iter->first);
|
||||
data->appendPackGUID(iter->second.counter);
|
||||
@@ -2209,7 +2206,7 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
|
||||
AchievementRewardLocale& data = m_achievementRewardLocales[entry];
|
||||
|
||||
for(int i = 1; i < MAX_LOCALE; ++i)
|
||||
for (int i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[1+2*(i-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -2240,7 +2237,6 @@ void AchievementGlobalMgr::LoadRewardLocales()
|
||||
|
||||
delete result;
|
||||
|
||||
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Loaded %lu achievement reward locale strings", (unsigned long)m_achievementRewardLocales.size() );
|
||||
}
|
||||
|
||||
@@ -186,7 +186,6 @@ struct AchievementCriteriaDataSet
|
||||
Storage storage;
|
||||
};
|
||||
|
||||
|
||||
typedef std::map<uint32,AchievementCriteriaDataSet> AchievementCriteriaDataMap;
|
||||
|
||||
struct AchievementReward
|
||||
@@ -208,7 +207,6 @@ struct AchievementRewardLocale
|
||||
|
||||
typedef std::map<uint32,AchievementRewardLocale> AchievementRewardLocales;
|
||||
|
||||
|
||||
struct CompletedAchievementData
|
||||
{
|
||||
time_t date;
|
||||
|
||||
@@ -298,7 +298,7 @@ void ArenaTeam::DelMember(uint64 guid)
|
||||
player->SetInArenaTeam(0, GetSlot());
|
||||
player->GetSession()->SendArenaTeamCommandResult(ERR_ARENA_TEAM_QUIT_S, GetName(), "", 0);
|
||||
// delete all info regarding this team
|
||||
for(uint8 i = 0; i < 6; ++i)
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
{
|
||||
player->SetUInt32Value(PLAYER_FIELD_ARENA_TEAM_INFO_1_1 + (GetSlot() * 6) + i, 0);
|
||||
}
|
||||
@@ -401,7 +401,7 @@ void ArenaTeam::NotifyStatsChanged()
|
||||
{
|
||||
// this is called after a rated match ended
|
||||
// updates arena team stats for every member of the team (not only the ones who participated!)
|
||||
for(MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
Player * plr = objmgr.GetPlayer(itr->guid);
|
||||
if(plr)
|
||||
@@ -550,7 +550,7 @@ void ArenaTeam::FinishGame(int32 mod)
|
||||
// update team's rank
|
||||
m_stats.rank = 1;
|
||||
ObjectMgr::ArenaTeamMap::const_iterator i = objmgr.GetArenaTeamMapBegin();
|
||||
for ( ; i != objmgr.GetArenaTeamMapEnd(); ++i)
|
||||
for (; i != objmgr.GetArenaTeamMapEnd(); ++i)
|
||||
{
|
||||
if (i->second->GetType() == m_Type && i->second->GetStats().rating > m_stats.rating)
|
||||
++m_stats.rank;
|
||||
@@ -590,7 +590,7 @@ int32 ArenaTeam::LostAgainst(uint32 againstRating)
|
||||
void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)
|
||||
{
|
||||
// called for each participant of a match after losing
|
||||
for(MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if(itr->guid == plr->GetGUID())
|
||||
{
|
||||
@@ -612,7 +612,7 @@ void ArenaTeam::MemberLost(Player * plr, uint32 againstRating)
|
||||
void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)
|
||||
{
|
||||
// called for offline player after ending rated arena match!
|
||||
for(MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if(itr->guid == guid)
|
||||
{
|
||||
@@ -634,7 +634,7 @@ void ArenaTeam::OfflineMemberLost(uint64 guid, uint32 againstRating)
|
||||
void ArenaTeam::MemberWon(Player * plr, uint32 againstRating)
|
||||
{
|
||||
// called for each participant after winning a match
|
||||
for(MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if(itr->guid == plr->GetGUID())
|
||||
{
|
||||
@@ -664,7 +664,7 @@ void ArenaTeam::UpdateArenaPointsHelper(std::map<uint32, uint32>& PlayerPoints)
|
||||
return;
|
||||
// to get points, a player has to participate in at least 30% of the matches
|
||||
uint32 min_plays = (uint32) ceil(m_stats.games_week * 0.3);
|
||||
for(MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
// the player participated in enough games, update his points
|
||||
uint32 points_to_add = 0;
|
||||
@@ -690,7 +690,7 @@ void ArenaTeam::SaveToDB()
|
||||
// called after a match has ended, or when calculating arena_points
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("UPDATE arena_team_stats SET rating = '%u',games = '%u',played = '%u',rank = '%u',wins = '%u',wins2 = '%u' WHERE arenateamid = '%u'", m_stats.rating, m_stats.games_week, m_stats.games_season, m_stats.rank, m_stats.wins_week, m_stats.wins_season, GetId());
|
||||
for(MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::const_iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
CharacterDatabase.PExecute("UPDATE arena_team_member SET played_week = '%u', wons_week = '%u', played_season = '%u', wons_season = '%u', personal_rating = '%u' WHERE arenateamid = '%u' AND guid = '%u'", itr->games_week, itr->wins_week, itr->games_season, itr->wins_season, itr->personal_rating, m_TeamId, GUID_LOPART(itr->guid));
|
||||
}
|
||||
@@ -701,7 +701,7 @@ void ArenaTeam::FinishWeek()
|
||||
{
|
||||
m_stats.games_week = 0; // played this week
|
||||
m_stats.wins_week = 0; // wins this week
|
||||
for(MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (MemberList::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
itr->games_week = 0;
|
||||
itr->wins_week = 0;
|
||||
|
||||
@@ -210,7 +210,7 @@ void AuctionHouseBot::addNewAuctions(Player *AHBplayer, AHBConfig *config)
|
||||
if (debug_Out) sLog.outString("AHSeller: %u items", items);
|
||||
|
||||
// only insert a few at a time, so as not to peg the processor
|
||||
for (uint32 cnt = 1;cnt <= items;cnt++)
|
||||
for (uint32 cnt = 1; cnt <= items; cnt++)
|
||||
{
|
||||
if (debug_Out) sLog.outString("AHSeller: %u count", cnt);
|
||||
uint32 itemID = 0;
|
||||
@@ -484,7 +484,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
|
||||
if (debug_Out) sLog.outError("AHBuyer: Disabled");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
QueryResult* result = CharacterDatabase.PQuery("SELECT id FROM auctionhouse WHERE itemowner<>%u AND buyguid<>%u", AHBplayerGUID, AHBplayerGUID);
|
||||
|
||||
if (!result)
|
||||
@@ -510,7 +510,7 @@ void AuctionHouseBot::addNewAuctionBuyerBotBid(Player *AHBplayer, AHBConfig *con
|
||||
}while (result->NextRow());
|
||||
delete result;
|
||||
|
||||
for (uint32 count = 1;count <= config->GetBidsPerInterval();++count)
|
||||
for (uint32 count = 1; count <= config->GetBidsPerInterval(); ++count)
|
||||
{
|
||||
// Do we have anything to bid? If not, stop here.
|
||||
if (possibleBids.empty())
|
||||
@@ -767,7 +767,6 @@ void AuctionHouseBot::Initialize()
|
||||
AHBplayerGUID = sConfig.GetIntDefault("AuctionHouseBot.GUID", 0);
|
||||
ItemsPerCycle = sConfig.GetIntDefault("AuctionHouseBot.ItemsPerCycle", 200);
|
||||
|
||||
|
||||
//Begin Filters
|
||||
|
||||
Vendor_Items = sConfig.GetBoolDefault("AuctionHouseBot.VendorItems", false);
|
||||
@@ -1774,10 +1773,10 @@ void AuctionHouseBot::LoadValues(AHBConfig *config)
|
||||
|
||||
config->ResetItemCounts();
|
||||
uint32 auctions = auctionHouse->Getcount();
|
||||
|
||||
|
||||
if (auctions)
|
||||
{
|
||||
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = auctionHouse->GetAuctionsBegin();itr != auctionHouse->GetAuctionsEnd();++itr)
|
||||
for (AuctionHouseObject::AuctionEntryMap::const_iterator itr = auctionHouse->GetAuctionsBegin(); itr != auctionHouse->GetAuctionsEnd(); ++itr)
|
||||
{
|
||||
AuctionEntry *Aentry = itr->second;
|
||||
Item *item = auctionmgr.GetAItem(Aentry->item_guidlow);
|
||||
|
||||
@@ -956,7 +956,7 @@ public:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void IncItemCounts(uint32 Class, uint32 Quality)
|
||||
{
|
||||
switch(Class)
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include "UpdateMask.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
//please DO NOT use iterator++, because it is slower than ++iterator!!!
|
||||
//post-incrementation is always slower than pre-incrementation !
|
||||
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "ProgressBar.h"
|
||||
#include <vector>
|
||||
|
||||
|
||||
INSTANTIATE_SINGLETON_1(AuctionHouseMgr);
|
||||
|
||||
using namespace std;
|
||||
@@ -564,7 +563,7 @@ void AuctionHouseObject::Update()
|
||||
|
||||
void AuctionHouseObject::BuildListBidderItems(WorldPacket& data, Player* player, uint32& count, uint32& totalcount)
|
||||
{
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||
{
|
||||
AuctionEntry *Aentry = itr->second;
|
||||
if (Aentry && Aentry->bidder == player->GetGUIDLow())
|
||||
@@ -579,7 +578,7 @@ void AuctionHouseObject::BuildListBidderItems(WorldPacket& data, Player* player,
|
||||
|
||||
void AuctionHouseObject::BuildListOwnerItems(WorldPacket& data, Player* player, uint32& count, uint32& totalcount)
|
||||
{
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||
{
|
||||
AuctionEntry *Aentry = itr->second;
|
||||
if (Aentry && Aentry->owner == player->GetGUIDLow())
|
||||
@@ -599,7 +598,7 @@ void AuctionHouseObject::BuildListAuctionItems(WorldPacket& data, Player* player
|
||||
{
|
||||
int loc_idx = player->GetSession()->GetSessionDbLocaleIndex();
|
||||
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin();itr != AuctionsMap.end();++itr)
|
||||
for (AuctionEntryMap::const_iterator itr = AuctionsMap.begin(); itr != AuctionsMap.end(); ++itr)
|
||||
{
|
||||
AuctionEntry *Aentry = itr->second;
|
||||
Item *item = auctionmgr.GetAItem(Aentry->item_guidlow);
|
||||
|
||||
+7
-7
@@ -38,7 +38,7 @@ Bag::Bag( ): Item()
|
||||
|
||||
Bag::~Bag()
|
||||
{
|
||||
for(uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
for (uint8 i = 0; i < MAX_BAG_SIZE; ++i)
|
||||
if (Item *item = m_bagslot[i])
|
||||
{
|
||||
if(item->IsInWorld())
|
||||
@@ -56,14 +56,14 @@ void Bag::AddToWorld()
|
||||
{
|
||||
Item::AddToWorld();
|
||||
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
for (uint32 i = 0; i < GetBagSize(); ++i)
|
||||
if(m_bagslot[i])
|
||||
m_bagslot[i]->AddToWorld();
|
||||
}
|
||||
|
||||
void Bag::RemoveFromWorld()
|
||||
{
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
for (uint32 i = 0; i < GetBagSize(); ++i)
|
||||
if(m_bagslot[i])
|
||||
m_bagslot[i]->RemoveFromWorld();
|
||||
|
||||
@@ -184,7 +184,7 @@ void Bag::BuildCreateUpdateBlockForPlayer( UpdateData *data, Player *target ) co
|
||||
// If the bag is empty returns true
|
||||
bool Bag::IsEmpty() const
|
||||
{
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
for (uint32 i = 0; i < GetBagSize(); ++i)
|
||||
if (m_bagslot[i])
|
||||
return false;
|
||||
|
||||
@@ -195,7 +195,7 @@ uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
|
||||
{
|
||||
Item *pItem;
|
||||
uint32 count = 0;
|
||||
for(uint32 i=0; i < GetBagSize(); ++i)
|
||||
for (uint32 i=0; i < GetBagSize(); ++i)
|
||||
{
|
||||
pItem = m_bagslot[i];
|
||||
if( pItem && pItem != eItem && pItem->GetEntry() == item )
|
||||
@@ -204,7 +204,7 @@ uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
|
||||
|
||||
if(eItem && eItem->GetProto()->GemProperties)
|
||||
{
|
||||
for(uint32 i=0; i < GetBagSize(); ++i)
|
||||
for (uint32 i=0; i < GetBagSize(); ++i)
|
||||
{
|
||||
pItem = m_bagslot[i];
|
||||
if( pItem && pItem != eItem && pItem->GetProto()->Socket[0].Color )
|
||||
@@ -217,7 +217,7 @@ uint32 Bag::GetItemCount( uint32 item, Item* eItem ) const
|
||||
|
||||
uint8 Bag::GetSlotByItemGUID(uint64 guid) const
|
||||
{
|
||||
for(uint32 i = 0; i < GetBagSize(); ++i)
|
||||
for (uint32 i = 0; i < GetBagSize(); ++i)
|
||||
if(m_bagslot[i] != 0)
|
||||
if(m_bagslot[i]->GetGUID() == guid)
|
||||
return i;
|
||||
|
||||
+26
-28
@@ -36,7 +36,6 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "Util.h"
|
||||
|
||||
|
||||
namespace MaNGOS
|
||||
{
|
||||
class BattleGroundChatBuilder
|
||||
@@ -122,7 +121,7 @@ namespace MaNGOS
|
||||
template<class Do>
|
||||
void BattleGround::BroadcastWorker(Do& _do)
|
||||
{
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
if (Player *plr = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
|
||||
_do(plr);
|
||||
}
|
||||
@@ -206,11 +205,11 @@ BattleGround::~BattleGround()
|
||||
// remove objects and creatures
|
||||
// (this is done automatically in mapmanager update, when the instance is reset after the reset time)
|
||||
int size = m_BgCreatures.size();
|
||||
for(int i = 0; i < size; ++i)
|
||||
for (int i = 0; i < size; ++i)
|
||||
DelCreature(i);
|
||||
|
||||
size = m_BgObjects.size();
|
||||
for(int i = 0; i < size; ++i)
|
||||
for (int i = 0; i < size; ++i)
|
||||
DelObject(i);
|
||||
|
||||
if (GetInstanceID()) // not spam by useless queries in case BG templates
|
||||
@@ -231,7 +230,7 @@ BattleGround::~BattleGround()
|
||||
// remove from bg free slot queue
|
||||
this->RemoveFromBGFreeSlotQueue();
|
||||
|
||||
for(BattleGroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
|
||||
for (BattleGroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
@@ -279,10 +278,10 @@ void BattleGround::Update(uint32 diff)
|
||||
{
|
||||
if (GetReviveQueueSize())
|
||||
{
|
||||
for(std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
{
|
||||
Creature *sh = NULL;
|
||||
for(std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
for (std::vector<uint64>::const_iterator itr2 = (itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr2);
|
||||
if (!plr)
|
||||
@@ -313,7 +312,7 @@ void BattleGround::Update(uint32 diff)
|
||||
}
|
||||
else if (m_LastResurrectTime > 500) // Resurrect players only half a second later, to see spirit heal effect on NPC
|
||||
{
|
||||
for(std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
for (std::vector<uint64>::const_iterator itr = m_ResurrectQueue.begin(); itr != m_ResurrectQueue.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(*itr);
|
||||
if (!plr)
|
||||
@@ -423,13 +422,13 @@ void BattleGround::Update(uint32 diff)
|
||||
{
|
||||
//TODO : add arena sound PlaySoundToAll(SOUND_ARENA_START);
|
||||
|
||||
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player *plr = objmgr.GetPlayer(itr->first))
|
||||
{
|
||||
plr->RemoveAurasDueToSpell(SPELL_ARENA_PREPARATION);
|
||||
// remove auras with duration lower than 30s
|
||||
Unit::AuraMap & aurMap = plr->GetAuras();
|
||||
for(Unit::AuraMap::iterator iter = aurMap.begin(); iter != aurMap.end();)
|
||||
for (Unit::AuraMap::iterator iter = aurMap.begin(); iter != aurMap.end(); )
|
||||
{
|
||||
if (!iter->second->IsPermanent()
|
||||
&& iter->second->GetAuraDuration()<=30*IN_MILISECONDS
|
||||
@@ -451,7 +450,7 @@ void BattleGround::Update(uint32 diff)
|
||||
|
||||
PlaySoundToAll(SOUND_BG_START);
|
||||
|
||||
for(BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
|
||||
if (Player* plr = objmgr.GetPlayer(itr->first))
|
||||
plr->RemoveAurasDueToSpell(SPELL_PREPARATION);
|
||||
//Announce BG starting
|
||||
@@ -475,7 +474,7 @@ void BattleGround::Update(uint32 diff)
|
||||
{
|
||||
m_EndTime = 0;
|
||||
BattleGroundPlayerMap::iterator itr, next;
|
||||
for(itr = m_Players.begin(); itr != m_Players.end(); itr = next)
|
||||
for (itr = m_Players.begin(); itr != m_Players.end(); itr = next)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
@@ -501,7 +500,7 @@ void BattleGround::SetTeamStartLoc(uint32 TeamID, float X, float Y, float Z, flo
|
||||
|
||||
void BattleGround::SendPacketToAll(WorldPacket *packet)
|
||||
{
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
if (plr)
|
||||
@@ -513,7 +512,7 @@ void BattleGround::SendPacketToAll(WorldPacket *packet)
|
||||
|
||||
void BattleGround::SendPacketToTeam(uint32 TeamID, WorldPacket *packet, Player *sender, bool self)
|
||||
{
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -545,7 +544,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
||||
{
|
||||
WorldPacket data;
|
||||
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -568,7 +567,7 @@ void BattleGround::PlaySoundToTeam(uint32 SoundID, uint32 TeamID)
|
||||
|
||||
void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
{
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -588,7 +587,7 @@ void BattleGround::CastSpellOnTeam(uint32 SpellID, uint32 TeamID)
|
||||
|
||||
void BattleGround::YellToAll(Creature* creature, const char* text, uint32 language)
|
||||
{
|
||||
for(std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (std::map<uint64, BattleGroundPlayer>::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
@@ -602,10 +601,9 @@ void BattleGround::YellToAll(Creature* creature, const char* text, uint32 langua
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BattleGround::RewardHonorToTeam(uint32 Honor, uint32 TeamID)
|
||||
{
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -630,7 +628,7 @@ void BattleGround::RewardReputationToTeam(uint32 faction_id, uint32 Reputation,
|
||||
if (!factionEntry)
|
||||
return;
|
||||
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -721,7 +719,7 @@ void BattleGround::EndBattleGround(uint32 winner)
|
||||
}
|
||||
}
|
||||
|
||||
for(BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
uint32 team = itr->second.Team;
|
||||
@@ -1125,7 +1123,7 @@ void BattleGround::Reset()
|
||||
|
||||
m_Players.clear();
|
||||
|
||||
for(BattleGroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
|
||||
for (BattleGroundScoreMap::const_iterator itr = m_PlayerScores.begin(); itr != m_PlayerScores.end(); ++itr)
|
||||
delete itr->second;
|
||||
m_PlayerScores.clear();
|
||||
|
||||
@@ -1251,7 +1249,7 @@ void BattleGround::AddOrSetPlayerToCorrectBgGroup(Player *plr, uint64 plr_guid,
|
||||
void BattleGround::EventPlayerLoggedIn(Player* player, uint64 plr_guid)
|
||||
{
|
||||
// player is correct pointer
|
||||
for(std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
||||
for (std::deque<uint64>::iterator itr = m_OfflineQueue.begin(); itr != m_OfflineQueue.end(); ++itr)
|
||||
{
|
||||
if (*itr == plr_guid)
|
||||
{
|
||||
@@ -1427,9 +1425,9 @@ void BattleGround::AddPlayerToResurrectQueue(uint64 npc_guid, uint64 player_guid
|
||||
|
||||
void BattleGround::RemovePlayerFromResurrectQueue(uint64 player_guid)
|
||||
{
|
||||
for(std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
for (std::map<uint64, std::vector<uint64> >::iterator itr = m_ReviveQueue.begin(); itr != m_ReviveQueue.end(); ++itr)
|
||||
{
|
||||
for(std::vector<uint64>::iterator itr2 =(itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
for (std::vector<uint64>::iterator itr2 =(itr->second).begin(); itr2 != (itr->second).end(); ++itr2)
|
||||
{
|
||||
if (*itr2 == player_guid)
|
||||
{
|
||||
@@ -1790,7 +1788,7 @@ void BattleGround::HandleKillPlayer( Player *player, Player *killer )
|
||||
UpdatePlayerScore(killer, SCORE_HONORABLE_KILLS, 1);
|
||||
UpdatePlayerScore(killer, SCORE_KILLING_BLOWS, 1);
|
||||
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(itr->first);
|
||||
|
||||
@@ -1850,7 +1848,7 @@ void BattleGround::PlayerAddedToBGCheckIfBGIsRunning(Player* plr)
|
||||
uint32 BattleGround::GetAlivePlayersCountByTeam(uint32 Team) const
|
||||
{
|
||||
int count = 0;
|
||||
for(BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
for (BattleGroundPlayerMap::const_iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
|
||||
{
|
||||
if (itr->second.Team == Team)
|
||||
{
|
||||
@@ -1872,7 +1870,7 @@ void BattleGround::SetHoliday(bool is_holiday)
|
||||
|
||||
int32 BattleGround::GetObjectType(uint64 guid)
|
||||
{
|
||||
for(uint32 i = 0; i < m_BgObjects.size(); ++i)
|
||||
for (uint32 i = 0; i < m_BgObjects.size(); ++i)
|
||||
if(m_BgObjects[i] == guid)
|
||||
return i;
|
||||
sLog.outError("BattleGround: cheating? a player used a gameobject which isnt supposed to be a usable object!");
|
||||
|
||||
@@ -543,7 +543,7 @@ class BattleGround
|
||||
void PlayerAddedToBGCheckIfBGIsRunning(Player* plr);
|
||||
|
||||
/* Scorekeeping */
|
||||
|
||||
|
||||
BattleGroundScoreMap m_PlayerScores; // Player scores
|
||||
// must be implemented in BG subclass
|
||||
virtual void RemovePlayer(Player * /*player*/, uint64 /*guid*/) {}
|
||||
|
||||
@@ -688,7 +688,7 @@ void BattleGroundAB::UpdatePlayerScore(Player *Source, uint32 type, uint32 value
|
||||
bool BattleGroundAB::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for(int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
|
||||
if ((team == ALLIANCE && m_Nodes[i] == BG_AB_NODE_STATUS_ALLY_OCCUPIED) ||
|
||||
(team == HORDE && m_Nodes[i] == BG_AB_NODE_STATUS_HORDE_OCCUPIED))
|
||||
++count;
|
||||
|
||||
+45
-55
@@ -90,7 +90,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),HORDE);
|
||||
UpdateScore(ALLIANCE,(-1)*BG_AV_RES_CAPTAIN);
|
||||
//spawn destroyed aura
|
||||
for(uint8 i=0; i<=9; i++)
|
||||
for (uint8 i=0; i<=9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_ALLIANCE+i,RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if(creature)
|
||||
@@ -109,7 +109,7 @@ void BattleGroundAV::HandleKillUnit(Creature *unit, Player *killer)
|
||||
RewardHonorToTeam(GetBonusHonor(BG_AV_KILL_CAPTAIN),ALLIANCE);
|
||||
UpdateScore(HORDE,(-1)*BG_AV_RES_CAPTAIN);
|
||||
//spawn destroyed aura
|
||||
for(uint8 i=0; i<=9; i++)
|
||||
for (uint8 i=0; i<=9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_BUILDING_HORDE+i,RESPAWN_IMMEDIATELY);
|
||||
Creature* creature = GetBGCreature(AV_CPLACE_HERALD);
|
||||
if(creature)
|
||||
@@ -224,7 +224,6 @@ void BattleGroundAV::HandleQuestComplete(uint32 questid, Player *player)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void BattleGroundAV::UpdateScore(uint16 team, int16 points )
|
||||
{ //note: to remove reinforcementpoints points must be negative, for adding reinforcements points must be positive
|
||||
assert( team == ALLIANCE || team == HORDE);
|
||||
@@ -302,7 +301,7 @@ void BattleGroundAV::Update(uint32 diff)
|
||||
|
||||
if(GetStatus() == STATUS_IN_PROGRESS)
|
||||
{
|
||||
for(uint8 i=0; i<=1;i++)//0=alliance, 1=horde
|
||||
for (uint8 i=0; i<=1; i++)//0=alliance, 1=horde
|
||||
{
|
||||
if(!m_CaptainAlive[i])
|
||||
continue;
|
||||
@@ -329,7 +328,7 @@ void BattleGroundAV::Update(uint32 diff)
|
||||
}
|
||||
//add points from mine owning, and look if he neutral team wanrts to reclaim the mine
|
||||
m_Mine_Timer -=diff;
|
||||
for(uint8 mine=0; mine <2; mine++)
|
||||
for (uint8 mine=0; mine <2; mine++)
|
||||
{
|
||||
if(m_Mine_Owner[mine] == ALLIANCE || m_Mine_Owner[mine] == HORDE)
|
||||
{
|
||||
@@ -347,7 +346,7 @@ void BattleGroundAV::Update(uint32 diff)
|
||||
m_Mine_Timer=AV_MINE_TICK_TIMER; //this is at the end, cause we need to update both mines
|
||||
|
||||
//looks for all timers of the nodes and destroy the building (for graveyards the building wont get destroyed, it goes just to the other team
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
|
||||
if(m_Nodes[i].State == POINT_ASSAULTED) //maybe remove this
|
||||
{
|
||||
if(m_Nodes[i].Timer > diff)
|
||||
@@ -367,11 +366,11 @@ void BattleGroundAV::StartingEventCloseDoors()
|
||||
void BattleGroundAV::StartingEventOpenDoors()
|
||||
{
|
||||
sLog.outDebug("BG_AV: start spawning mine stuff");
|
||||
for(uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i<=BG_AV_OBJECT_MINE_SUPPLY_N_MAX;i++)
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_N_MIN; i<=BG_AV_OBJECT_MINE_SUPPLY_N_MAX; i++)
|
||||
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
|
||||
for(uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i<=BG_AV_OBJECT_MINE_SUPPLY_S_MAX;i++)
|
||||
for (uint16 i= BG_AV_OBJECT_MINE_SUPPLY_S_MIN; i<=BG_AV_OBJECT_MINE_SUPPLY_S_MAX; i++)
|
||||
SpawnBGObject(i,RESPAWN_IMMEDIATELY);
|
||||
for(uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
|
||||
for (uint8 mine = AV_NORTH_MINE; mine <= AV_SOUTH_MINE; mine++) //mine population
|
||||
ChangeMineOwner(mine, AV_NEUTRAL_TEAM,true);
|
||||
|
||||
UpdateWorldState(AV_SHOW_H_SCORE, 1);
|
||||
@@ -398,7 +397,7 @@ void BattleGroundAV::EndBattleGround(uint32 winner)
|
||||
//first towers:
|
||||
uint8 kills[2]={0,0}; //0=ally 1=horde
|
||||
uint8 rep[2]={0,0}; //0=ally 1=horde
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i)
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i)
|
||||
{
|
||||
if(m_Nodes[i].State == POINT_CONTROLED)
|
||||
{
|
||||
@@ -415,7 +414,7 @@ void BattleGroundAV::EndBattleGround(uint32 winner)
|
||||
}
|
||||
}
|
||||
|
||||
for(int i=0; i<=1; i++) //0=ally 1=horde
|
||||
for (int i=0; i<=1; i++) //0=ally 1=horde
|
||||
{
|
||||
if(m_CaptainAlive[i])
|
||||
{
|
||||
@@ -445,7 +444,6 @@ void BattleGroundAV::RemovePlayer(Player* plr,uint64 /*guid*/)
|
||||
plr->RemoveAurasDueToSpell(AV_BUFF_H_CAPTAIN);
|
||||
}
|
||||
|
||||
|
||||
void BattleGroundAV::HandleAreaTrigger(Player *Source, uint32 Trigger)
|
||||
{
|
||||
// this is wrong way to implement these things. On official it done by gameobject spell cast.
|
||||
@@ -522,8 +520,6 @@ void BattleGroundAV::UpdatePlayerScore(Player* Source, uint32 type, uint32 value
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
{
|
||||
|
||||
@@ -545,7 +541,7 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
else
|
||||
sLog.outError("BG_AV: playerdestroyedpoint: marshal %i doesn't exist",AV_CPLACE_A_MARSHAL_SOUTH + tmp);
|
||||
//spawn destroyed aura
|
||||
for(uint8 i=0; i<=9; i++)
|
||||
for (uint8 i=0; i<=9; i++)
|
||||
SpawnBGObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH + i + (tmp * 10),RESPAWN_IMMEDIATELY);
|
||||
|
||||
UpdateScore((owner == ALLIANCE) ? HORDE : ALLIANCE, (-1)*BG_AV_RES_TOWER);
|
||||
@@ -566,7 +562,7 @@ void BattleGroundAV::EventPlayerDestroyedPoint(BG_AV_Nodes node)
|
||||
PopulateNode(node);
|
||||
if(node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
|
||||
{
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H )+i,RESPAWN_IMMEDIATELY);
|
||||
@@ -603,10 +599,10 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
{
|
||||
sLog.outDebug("bg_av depopulating mine %i (0=north,1=south)",mine);
|
||||
if(mine==AV_SOUTH_MINE)
|
||||
for(uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
if( m_BgCreatures[i] )
|
||||
DelCreature(i); //TODO just set the respawntime to 999999
|
||||
for(uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); i++)
|
||||
for (uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3); i++)
|
||||
if( m_BgCreatures[i] )
|
||||
DelCreature(i); //TODO here also
|
||||
}
|
||||
@@ -641,17 +637,17 @@ void BattleGroundAV::ChangeMineOwner(uint8 mine, uint32 team, bool initial)
|
||||
cinfo = AV_NPC_S_MINE_H_3;
|
||||
else
|
||||
cinfo = AV_NPC_S_MINE_N_S;
|
||||
for(uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
for (uint16 i=AV_CPLACE_MINE_S_S_MIN; i <= AV_CPLACE_MINE_S_S_MAX; i++)
|
||||
AddAVCreature(cinfo,i);
|
||||
}
|
||||
for(uint16 i=( (mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN ); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
|
||||
for (uint16 i=( (mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MIN:AV_CPLACE_MINE_S_1_MIN ); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_1_MAX:AV_CPLACE_MINE_S_1_MAX); i++)
|
||||
AddAVCreature(miner,i);
|
||||
//the next chooses randomly between 2 cretures
|
||||
for(uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++)
|
||||
for (uint16 i=((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MIN:AV_CPLACE_MINE_S_2_MIN); i <= ((mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_2_MAX:AV_CPLACE_MINE_S_2_MAX); i++)
|
||||
AddAVCreature(miner+(urand(1,2)),i);
|
||||
AddAVCreature(miner+3,(mine==AV_NORTH_MINE)?AV_CPLACE_MINE_N_3:AV_CPLACE_MINE_S_3);
|
||||
//because the gameobjects in this mine have changed, update all surrounding players:
|
||||
// for(uint16 i = ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++)
|
||||
// for (uint16 i = ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MIN:BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i <= ((mine==AV_NORTH_MINE)?BG_AV_OBJECT_MINE_SUPPLY_N_MAX:BG_AV_OBJECT_MINE_SUPPLY_N_MAX); i++)
|
||||
// {
|
||||
//TODO: add gameobject-update code
|
||||
// }
|
||||
@@ -711,7 +707,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
sLog.outError("AV: couldn't spawn spiritguide at node %i",node);
|
||||
|
||||
}
|
||||
for(uint8 i=0; i<4; i++)
|
||||
for (uint8 i=0; i<4; i++)
|
||||
{
|
||||
Creature* cr = AddAVCreature(creatureid,c_place+i);
|
||||
}
|
||||
@@ -719,7 +715,7 @@ void BattleGroundAV::PopulateNode(BG_AV_Nodes node)
|
||||
void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
{
|
||||
uint32 c_place = AV_CPLACE_DEFENSE_STORM_AID + ( 4 * node );
|
||||
for(uint8 i=0; i<4; i++)
|
||||
for (uint8 i=0; i<4; i++)
|
||||
if( m_BgCreatures[c_place+i] )
|
||||
DelCreature(c_place+i);
|
||||
//spiritguide
|
||||
@@ -727,7 +723,6 @@ void BattleGroundAV::DePopulateNode(BG_AV_Nodes node)
|
||||
DelCreature(node);
|
||||
}
|
||||
|
||||
|
||||
const BG_AV_Nodes BattleGroundAV::GetNodeThroughObject(uint32 object)
|
||||
{
|
||||
sLog.outDebug("bg_AV getnodethroughobject %i",object);
|
||||
@@ -786,7 +781,6 @@ const uint32 BattleGroundAV::GetObjectThroughNode(BG_AV_Nodes node)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
//called when using banner
|
||||
|
||||
void BattleGroundAV::EventPlayerClickedOnFlag(Player *source, GameObject* target_obj)
|
||||
@@ -840,7 +834,6 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//spawn new go :)
|
||||
if(m_Nodes[node].Owner == ALLIANCE)
|
||||
SpawnBGObject(object+22, RESPAWN_IMMEDIATELY); //spawn horde banner
|
||||
@@ -869,7 +862,7 @@ void BattleGroundAV::EventPlayerDefendsPoint(Player* player, uint32 object)
|
||||
}
|
||||
else if(node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall eyecandy
|
||||
{
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SpawnBGObject(((owner==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_PH)+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(((team==ALLIANCE)?BG_AV_OBJECT_SNOW_EYECANDY_A : BG_AV_OBJECT_SNOW_EYECANDY_H)+i,RESPAWN_IMMEDIATELY);
|
||||
@@ -900,7 +893,6 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
if(owner == team || team == m_Nodes[node].TotalOwner)
|
||||
return; //surely a gm used this object
|
||||
|
||||
|
||||
if(node == BG_AV_NODES_SNOWFALL_GRAVE) //snowfall is a bit special in capping + it gets eyecandy stuff
|
||||
{
|
||||
if(object == BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE) //initial capping
|
||||
@@ -932,7 +924,7 @@ void BattleGroundAV::EventPlayerAssaultsPoint(Player* player, uint32 object)
|
||||
despawn = ( m_Nodes[node].State == POINT_ASSAULTED )?BG_AV_OBJECT_SNOW_EYECANDY_PA : BG_AV_OBJECT_SNOW_EYECANDY_A;
|
||||
spawn = BG_AV_OBJECT_SNOW_EYECANDY_PH;
|
||||
}
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
SpawnBGObject(despawn+i,RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(spawn+i,RESPAWN_IMMEDIATELY);
|
||||
@@ -1094,7 +1086,6 @@ void BattleGroundAV::SendMineWorldStates(uint32 mine)
|
||||
UpdateWorldState(BG_AV_MineWorldStates[mine2][prevowner],0);
|
||||
}
|
||||
|
||||
|
||||
WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
|
||||
{
|
||||
WorldSafeLocsEntry const* good_entry = NULL;
|
||||
@@ -1124,7 +1115,6 @@ WorldSafeLocsEntry const* BattleGroundAV::GetClosestGraveYard(Player* player)
|
||||
return good_entry;
|
||||
}
|
||||
|
||||
|
||||
bool BattleGroundAV::SetupBattleGround()
|
||||
{
|
||||
// Create starting objects
|
||||
@@ -1184,7 +1174,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(uint8 j=0; j<=9; j++) //burning aura
|
||||
for (uint8 j=0; j<=9; j++) //burning aura
|
||||
{
|
||||
if(!AddObject(BG_AV_OBJECT_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j,BG_AV_OBJECTID_FIRE,BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][0],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][1],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][2],BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_BURN_DUNBALDAR_SOUTH+((i-BG_AV_NODES_DUNBALDAR_SOUTH)*10)+j][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
@@ -1194,9 +1184,9 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(uint8 i=0;i<2;i++) //burning aura for buildings
|
||||
for (uint8 i=0; i<2; i++) //burning aura for buildings
|
||||
{
|
||||
for(uint8 j=0; j<=9; j++)
|
||||
for (uint8 j=0; j<=9; j++)
|
||||
{
|
||||
if(j<5)
|
||||
{
|
||||
@@ -1216,7 +1206,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(uint16 i= 0; i<=(BG_AV_OBJECT_MINE_SUPPLY_N_MAX-BG_AV_OBJECT_MINE_SUPPLY_N_MIN);i++)
|
||||
for (uint16 i= 0; i<=(BG_AV_OBJECT_MINE_SUPPLY_N_MAX-BG_AV_OBJECT_MINE_SUPPLY_N_MIN); i++)
|
||||
{
|
||||
if(!AddObject(BG_AV_OBJECT_MINE_SUPPLY_N_MIN+i,BG_AV_OBJECTID_MINE_N,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_N_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
@@ -1224,7 +1214,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for(uint16 i= 0 ; i<=(BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN);i++)
|
||||
for (uint16 i= 0 ; i<=(BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++)
|
||||
{
|
||||
if(!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i,BG_AV_OBJECTID_MINE_S,BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2],BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2),RESPAWN_ONE_DAY))
|
||||
{
|
||||
@@ -1238,7 +1228,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
sLog.outError("BatteGroundAV: Failed to spawn some object BattleGround not created!8");
|
||||
return false;
|
||||
}
|
||||
for(uint8 i = 0; i < 4; i++)
|
||||
for (uint8 i = 0; i < 4; i++)
|
||||
{
|
||||
if(!AddObject(BG_AV_OBJECT_SNOW_EYECANDY_A+i, BG_AV_OBJECTID_SNOWFALL_CANDY_A ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|
||||
|| !AddObject(BG_AV_OBJECT_SNOW_EYECANDY_PA+i, BG_AV_OBJECTID_SNOWFALL_CANDY_PA ,BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][0],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][1],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][2],BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3],0,0,sin(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_SNOW_1+i][3]/2), RESPAWN_ONE_DAY)
|
||||
@@ -1253,44 +1243,44 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
uint16 i;
|
||||
sLog.outDebug("Alterac Valley: entering state STATUS_WAIT_JOIN ...");
|
||||
// Initial Nodes
|
||||
for(i = 0; i < BG_AV_OBJECT_MAX; i++)
|
||||
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
for(i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){
|
||||
for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i,RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
for(i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++)
|
||||
for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
for(i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){
|
||||
for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
if(i<=BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT)
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i),RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
for(i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2)
|
||||
for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2)
|
||||
{
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag
|
||||
SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
|
||||
}
|
||||
for(i = BG_AV_OBJECT_TFLAG_H_ICEBLOOD_TOWER; i <= BG_AV_OBJECT_TFLAG_H_FROSTWOLF_WTOWER; i+=2)
|
||||
for (i = BG_AV_OBJECT_TFLAG_H_ICEBLOOD_TOWER; i <= BG_AV_OBJECT_TFLAG_H_FROSTWOLF_WTOWER; i+=2)
|
||||
{
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag
|
||||
SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
|
||||
}
|
||||
//snowfall and the doors
|
||||
for(i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++)
|
||||
for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE,RESPAWN_IMMEDIATELY);
|
||||
|
||||
//creatures
|
||||
sLog.outDebug("BG_AV start poputlating nodes");
|
||||
for(BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i )
|
||||
for (BG_AV_Nodes i= BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i )
|
||||
{
|
||||
if(m_Nodes[i].Owner)
|
||||
PopulateNode(i);
|
||||
}
|
||||
//all creatures which don't get despawned through the script are static
|
||||
sLog.outDebug("BG_AV: start spawning static creatures");
|
||||
for(i=0; i < AV_STATICCPLACE_MAX; i++ )
|
||||
for (i=0; i < AV_STATICCPLACE_MAX; i++ )
|
||||
AddAVCreature(0,i+AV_CPLACE_MAX);
|
||||
//mainspiritguides:
|
||||
sLog.outDebug("BG_AV: start spawning spiritguides creatures");
|
||||
@@ -1298,7 +1288,7 @@ bool BattleGroundAV::SetupBattleGround()
|
||||
AddSpiritGuide(8, BG_AV_CreaturePos[8][0], BG_AV_CreaturePos[8][1], BG_AV_CreaturePos[8][2], BG_AV_CreaturePos[8][3], HORDE);
|
||||
//spawn the marshals (those who get deleted, if a tower gets destroyed)
|
||||
sLog.outDebug("BG_AV: start spawning marshal creatures");
|
||||
for(i=AV_NPC_A_MARSHAL_SOUTH; i<= AV_NPC_H_MARSHAL_WTOWER; i++)
|
||||
for (i=AV_NPC_A_MARSHAL_SOUTH; i<= AV_NPC_H_MARSHAL_WTOWER; i++)
|
||||
AddAVCreature(i,AV_CPLACE_A_MARSHAL_SOUTH+(i-AV_NPC_A_MARSHAL_SOUTH));
|
||||
AddAVCreature(AV_NPC_HERALD,AV_CPLACE_HERALD);
|
||||
return true;
|
||||
@@ -1400,9 +1390,9 @@ void BattleGroundAV::DefendNode(BG_AV_Nodes node, uint16 team)
|
||||
void BattleGroundAV::ResetBGSubclass()
|
||||
{
|
||||
m_MaxLevel=0;
|
||||
for(uint8 i=0; i<2; i++) //forloop for both teams (it just make 0==alliance and 1==horde also for both mines 0=north 1=south
|
||||
for (uint8 i=0; i<2; i++) //forloop for both teams (it just make 0==alliance and 1==horde also for both mines 0=north 1=south
|
||||
{
|
||||
for(uint8 j=0; j<9; j++)
|
||||
for (uint8 j=0; j<9; j++)
|
||||
m_Team_QuestStatus[i][j]=0;
|
||||
m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS;
|
||||
m_IsInformedNearVictory[i]=false;
|
||||
@@ -1411,18 +1401,18 @@ void BattleGroundAV::ResetBGSubclass()
|
||||
m_Mine_Owner[i] = AV_NEUTRAL_TEAM;
|
||||
m_Mine_PrevOwner[i] = m_Mine_Owner[i];
|
||||
}
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i <= BG_AV_NODES_STONEHEART_GRAVE; ++i) //alliance graves
|
||||
InitNode(i,ALLIANCE,false);
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_DUNBALDAR_SOUTH; i <= BG_AV_NODES_STONEHEART_BUNKER; ++i) //alliance towers
|
||||
InitNode(i,ALLIANCE,true);
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_GRAVE; i <= BG_AV_NODES_FROSTWOLF_HUT; ++i) //horde graves
|
||||
InitNode(i,HORDE,false);
|
||||
for(BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers
|
||||
for (BG_AV_Nodes i = BG_AV_NODES_ICEBLOOD_TOWER; i <= BG_AV_NODES_FROSTWOLF_WTOWER; ++i) //horde towers
|
||||
InitNode(i,HORDE,true);
|
||||
InitNode(BG_AV_NODES_SNOWFALL_GRAVE,AV_NEUTRAL_TEAM,false); //give snowfall neutral owner
|
||||
|
||||
m_Mine_Timer=AV_MINE_TICK_TIMER;
|
||||
for(uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
|
||||
for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
|
||||
if(m_BgCreatures[i])
|
||||
DelCreature(i);
|
||||
|
||||
|
||||
@@ -97,7 +97,6 @@ horde:
|
||||
AV_SOUND_ALLIANCE_CAPTAIN = 8232, //gets called when someone attacks them and at the beginning after 3min+rand(x)*10sec (maybe buff)
|
||||
AV_SOUND_HORDE_CAPTAIN = 8333,
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum BG_AV_OTHER_VALUES
|
||||
@@ -310,8 +309,6 @@ enum BG_AV_ObjectTypes
|
||||
BG_AV_OBJECT_MAX = 237
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum BG_AV_OBJECTS
|
||||
{
|
||||
AV_OPLACE_FIRSTAID_STATION = 0,
|
||||
@@ -535,7 +532,6 @@ const float BG_AV_DoorPositons[2][4] = {
|
||||
{-1375.193f, -538.981f, 55.2824f, 0.72178f} //horde
|
||||
};
|
||||
|
||||
|
||||
//creaturestuff starts here
|
||||
//is related to BG_AV_CreaturePos
|
||||
enum BG_AV_CreaturePlace
|
||||
@@ -942,7 +938,6 @@ const float BG_AV_CreaturePos[AV_CPLACE_MAX][4] = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
enum BG_AV_CreatureIds
|
||||
{
|
||||
|
||||
@@ -1256,8 +1251,6 @@ enum BG_AV_Graveyards
|
||||
AV_GRAVE_MAIN_HORDE = 610
|
||||
};
|
||||
|
||||
|
||||
|
||||
const uint32 BG_AV_GraveyardIds[9]= {
|
||||
AV_GRAVE_STORM_AID,
|
||||
AV_GRAVE_STORM_GRAVE,
|
||||
@@ -1338,7 +1331,6 @@ enum BG_AV_WorldStates
|
||||
AV_FROSTWOLFHUT_H_C = 1330,
|
||||
AV_FROSTWOLFHUT_H_A = 1332, //over ac
|
||||
|
||||
|
||||
//Towers
|
||||
//Alliance
|
||||
//Dunbaldar South Bunker
|
||||
@@ -1405,7 +1397,6 @@ const uint32 BG_AV_MineWorldStates[2][3] = {
|
||||
{1355, 1357,1356}
|
||||
};
|
||||
|
||||
|
||||
//alliance_control alliance_assault h_control h_assault
|
||||
const uint32 BG_AV_NodeWorldStates[16][4] = {
|
||||
//Stormpike first aid station
|
||||
@@ -1523,7 +1514,6 @@ class BattleGroundAV : public BattleGround
|
||||
void HandleQuestComplete(uint32 questid, Player *player);
|
||||
bool PlayerCanDoMineQuest(int32 GOId,uint32 team);
|
||||
|
||||
|
||||
void EndBattleGround(uint32 winner);
|
||||
|
||||
virtual WorldSafeLocsEntry const* GetClosestGraveYard(Player* player);
|
||||
@@ -1547,7 +1537,6 @@ class BattleGroundAV : public BattleGround
|
||||
const char* GetNodeName(BG_AV_Nodes node);
|
||||
const bool IsTower(BG_AV_Nodes node) { return m_Nodes[node].Tower; }
|
||||
|
||||
|
||||
/*mine*/
|
||||
void ChangeMineOwner(uint8 mine, uint32 team, bool initial=false);
|
||||
|
||||
@@ -1577,7 +1566,6 @@ class BattleGroundAV : public BattleGround
|
||||
uint8 m_MaxLevel; //TODO remove this when battleground-getmaxlevel() returns something usefull
|
||||
bool m_IsInformedNearVictory[2];
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,19 +58,19 @@ void BattleGroundBE::Update(uint32 diff)
|
||||
|
||||
void BattleGroundBE::StartingEventCloseDoors()
|
||||
{
|
||||
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; ++i)
|
||||
for (uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_4; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
|
||||
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; ++i)
|
||||
for (uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
void BattleGroundBE::StartingEventOpenDoors()
|
||||
{
|
||||
for(uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; ++i)
|
||||
for (uint32 i = BG_BE_OBJECT_DOOR_1; i <= BG_BE_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
|
||||
for(uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; ++i)
|
||||
for (uint32 i = BG_BE_OBJECT_BUFF_1; i <= BG_BE_OBJECT_BUFF_2; ++i)
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ void BattleGroundEY::StartingEventCloseDoors()
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_IMMEDIATELY);
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_IMMEDIATELY);
|
||||
|
||||
for(uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
|
||||
for (uint32 i = BG_EY_OBJECT_A_BANNER_FEL_REALVER_CENTER; i < BG_EY_OBJECT_MAX; ++i)
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
@@ -116,9 +116,9 @@ void BattleGroundEY::StartingEventOpenDoors()
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_A, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_EY_OBJECT_DOOR_H, RESPAWN_ONE_DAY);
|
||||
|
||||
for(uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
|
||||
for (uint32 i = BG_EY_OBJECT_N_BANNER_FEL_REALVER_CENTER; i <= BG_EY_OBJECT_FLAG_NETHERSTORM; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
for(uint32 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
for (uint32 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
//randomly spawn buff
|
||||
uint8 buff = urand(0, 2);
|
||||
@@ -182,7 +182,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
for (uint8 i = 0; i < 2*EY_POINTS_MAX; ++i)
|
||||
m_CurrentPointPlayersCount[i] = 0;
|
||||
GameObject *obj = NULL;
|
||||
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
obj = HashMapHolder<GameObject>::Find(m_BgObjects[BG_EY_OBJECT_TOWER_CAP_FEL_REALVER + i]);
|
||||
if (obj)
|
||||
@@ -220,7 +220,7 @@ void BattleGroundEY::CheckSomeoneLeftPoint()
|
||||
|
||||
void BattleGroundEY::UpdatePointStatuses()
|
||||
{
|
||||
for(uint8 point = 0; point < EY_POINTS_MAX; ++point)
|
||||
for (uint8 point = 0; point < EY_POINTS_MAX; ++point)
|
||||
{
|
||||
if (m_PlayersNearPoint[point].empty())
|
||||
continue;
|
||||
@@ -350,7 +350,7 @@ void BattleGroundEY::RemovePlayer(Player *plr, uint64 guid)
|
||||
// sometimes flag aura not removed :(
|
||||
for (int j = EY_POINTS_MAX; j >= 0; --j)
|
||||
{
|
||||
for(size_t i = 0; i < m_PlayersNearPoint[j].size(); ++i)
|
||||
for (size_t i = 0; i < m_PlayersNearPoint[j].size(); ++i)
|
||||
if (m_PlayersNearPoint[j][i] == guid)
|
||||
m_PlayersNearPoint[j].erase(m_PlayersNearPoint[j].begin() + i);
|
||||
}
|
||||
@@ -532,7 +532,7 @@ void BattleGroundEY::Reset()
|
||||
bool isBGWeekend = sBattleGroundMgr.IsBGWeekend(GetTypeID());
|
||||
m_HonorTics = (isBGWeekend) ? BG_EY_EYWeekendHonorTicks : BG_EY_NotEYWeekendHonorTicks;
|
||||
|
||||
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
m_PointOwnedByTeam[i] = EY_POINT_NO_OWNER;
|
||||
m_PointState[i] = EY_POINT_STATE_UNCONTROLLED;
|
||||
@@ -881,11 +881,10 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
float plr_y = player->GetPositionY();
|
||||
float plr_z = player->GetPositionZ();
|
||||
|
||||
|
||||
distance = (entry->x - plr_x)*(entry->x - plr_x) + (entry->y - plr_y)*(entry->y - plr_y) + (entry->z - plr_z)*(entry->z - plr_z);
|
||||
nearestDistance = distance;
|
||||
|
||||
for(uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
|
||||
{
|
||||
if (m_PointOwnedByTeam[i]==player->GetTeam() && m_PointState[i]==EY_POINT_UNDER_CONTROL)
|
||||
{
|
||||
@@ -910,7 +909,7 @@ WorldSafeLocsEntry const *BattleGroundEY::GetClosestGraveYard(Player* player)
|
||||
bool BattleGroundEY::IsAllNodesConrolledByTeam(uint32 team) const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for(int i = 0; i < EY_POINTS_MAX; ++i)
|
||||
for (int i = 0; i < EY_POINTS_MAX; ++i)
|
||||
if (m_PointOwnedByTeam[i] == team && m_PointState[i] == EY_POINT_UNDER_CONTROL)
|
||||
++count;
|
||||
|
||||
|
||||
@@ -153,7 +153,7 @@ void WorldSession::HandleBattlemasterJoinOpcode( WorldPacket & recv_data )
|
||||
if (joinAsGroup /* && _player->GetGroup()*/)
|
||||
{
|
||||
sLog.outDebug("Battleground: the following players are joining as group:");
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
if(!member) continue; // this should never happen
|
||||
@@ -215,7 +215,7 @@ void WorldSession::HandleBattleGroundPlayerPositionsOpcode( WorldPacket & /*recv
|
||||
|
||||
WorldPacket data(MSG_BATTLEGROUND_PLAYER_POSITIONS, (4+4+16*count1+16*count2));
|
||||
data << count1; // alliance flag holders count - obsolete, now always 0
|
||||
/*for(uint8 i = 0; i < count1; ++i)
|
||||
/*for (uint8 i = 0; i < count1; ++i)
|
||||
{
|
||||
data << uint64(0); // guid
|
||||
data << (float)0; // x
|
||||
@@ -710,7 +710,7 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
// the arenateam id must match for everyone in the group
|
||||
// get the personal ratings for queueing
|
||||
uint32 avg_pers_rating = 0;
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
|
||||
@@ -738,8 +738,8 @@ void WorldSession::HandleBattlemasterJoinArena( WorldPacket & recv_data )
|
||||
}
|
||||
else
|
||||
bg->SetRated(false);
|
||||
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
|
||||
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
if(!member) continue;
|
||||
|
||||
@@ -54,13 +54,13 @@ INSTANTIATE_SINGLETON_1( BattleGroundMgr );
|
||||
|
||||
BattleGroundQueue::BattleGroundQueue()
|
||||
{
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
for(uint32 j = 0; j < MAX_BATTLEGROUND_QUEUES; j++)
|
||||
for (uint32 j = 0; j < MAX_BATTLEGROUND_QUEUES; j++)
|
||||
{
|
||||
m_SumOfWaitTimes[i][j] = 0;
|
||||
m_WaitTimeLastPlayer[i][j] = 0;
|
||||
for(uint32 k = 0; k < COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME; k++)
|
||||
for (uint32 k = 0; k < COUNT_OF_PLAYERS_TO_AVERAGE_WAIT_TIME; k++)
|
||||
m_WaitTimes[i][j][k] = 0;
|
||||
}
|
||||
}
|
||||
@@ -71,9 +71,9 @@ BattleGroundQueue::~BattleGroundQueue()
|
||||
m_QueuedPlayers.clear();
|
||||
for (int i = 0; i < MAX_BATTLEGROUND_QUEUES; i++)
|
||||
{
|
||||
for(uint32 j = 0; j < BG_QUEUE_GROUP_TYPES_COUNT; j++)
|
||||
for (uint32 j = 0; j < BG_QUEUE_GROUP_TYPES_COUNT; j++)
|
||||
{
|
||||
for(GroupsQueueType::iterator itr = m_QueuedGroups[i][j].begin(); itr!= m_QueuedGroups[i][j].end(); ++itr)
|
||||
for (GroupsQueueType::iterator itr = m_QueuedGroups[i][j].begin(); itr!= m_QueuedGroups[i][j].end(); ++itr)
|
||||
delete (*itr);
|
||||
m_QueuedGroups[i][j].clear();
|
||||
}
|
||||
@@ -273,7 +273,7 @@ void BattleGroundQueue::RemovePlayer(const uint64& guid, bool decreaseInvitedCou
|
||||
//they leave groupinfo so we can't use its players size to find out index
|
||||
for (uint32 j = index; j < BG_QUEUE_GROUP_TYPES_COUNT; j += BG_QUEUE_NORMAL_ALLIANCE)
|
||||
{
|
||||
for(group_itr_tmp = m_QueuedGroups[queue_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[queue_id_tmp][j].end(); ++group_itr_tmp)
|
||||
for (group_itr_tmp = m_QueuedGroups[queue_id_tmp][j].begin(); group_itr_tmp != m_QueuedGroups[queue_id_tmp][j].end(); ++group_itr_tmp)
|
||||
{
|
||||
if ((*group_itr_tmp) == group)
|
||||
{
|
||||
@@ -415,10 +415,10 @@ void BattleGroundQueue::AnnounceWorld(GroupQueueInfo *ginfo, const uint64& playe
|
||||
uint32 q_min_level = (queue_id + 1) * 10;
|
||||
uint32 q_max_level = std::min(q_min_level + 9, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
||||
GroupsQueueType::const_iterator itr;
|
||||
for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr)
|
||||
for (itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE].end(); ++itr)
|
||||
if (!(*itr)->IsInvitedToBGInstanceGUID)
|
||||
qAlliance += (*itr)->Players.size();
|
||||
for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].end(); ++itr)
|
||||
for (itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_HORDE].end(); ++itr)
|
||||
if (!(*itr)->IsInvitedToBGInstanceGUID)
|
||||
qHorde += (*itr)->Players.size();
|
||||
|
||||
@@ -460,7 +460,7 @@ bool BattleGroundQueue::InviteGroupToBG(GroupQueueInfo * ginfo, BattleGround * b
|
||||
ginfo->RemoveInviteTime = getMSTime() + INVITE_ACCEPT_WAIT_TIME;
|
||||
|
||||
// loop through the players
|
||||
for(std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
|
||||
for (std::map<uint64,PlayerQueueInfo*>::iterator itr = ginfo->Players.begin(); itr != ginfo->Players.end(); ++itr)
|
||||
{
|
||||
// get the player
|
||||
Player* plr = objmgr.GetPlayer(itr->first);
|
||||
@@ -591,10 +591,10 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
//start premade match
|
||||
//if groups aren't invited
|
||||
GroupsQueueType::const_iterator ali_group, horde_group;
|
||||
for( ali_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group)
|
||||
for (ali_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].begin(); ali_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++ali_group)
|
||||
if (!(*ali_group)->IsInvitedToBGInstanceGUID)
|
||||
break;
|
||||
for( horde_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].begin(); horde_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++horde_group)
|
||||
for (horde_group = m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].begin(); horde_group != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++horde_group)
|
||||
if (!(*horde_group)->IsInvitedToBGInstanceGUID)
|
||||
break;
|
||||
|
||||
@@ -605,9 +605,9 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
//add groups/players from normal queue to size of bigger group
|
||||
uint32 maxPlayers = std::min(m_SelectionPools[BG_TEAM_ALLIANCE].GetPlayerCount(), m_SelectionPools[BG_TEAM_HORDE].GetPlayerCount());
|
||||
GroupsQueueType::const_iterator itr;
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
for(itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
|
||||
for (itr = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin(); itr != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++itr)
|
||||
{
|
||||
//if itr can join BG and player count is less that maxPlayers, then add group to selectionpool
|
||||
if (!(*itr)->IsInvitedToBGInstanceGUID && !m_SelectionPools[i].AddGroup((*itr), maxPlayers))
|
||||
@@ -623,7 +623,7 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
// if first is invited to BG and seconds timer expired, but we can ignore it, because players have only 80 seconds to click to enter bg
|
||||
// and when they click or after 80 seconds the queue info is removed from queue
|
||||
uint32 time_before = getMSTime() - sWorld.getConfig(CONFIG_BATTLEGROUND_PREMADE_GROUP_WAIT_FOR_MATCH);
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
if (!m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE + i].empty())
|
||||
{
|
||||
@@ -644,10 +644,10 @@ bool BattleGroundQueue::CheckPremadeMatch(BGQueueIdBasedOnLevel queue_id, uint32
|
||||
bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BGQueueIdBasedOnLevel queue_id, uint32 minPlayers, uint32 maxPlayers)
|
||||
{
|
||||
GroupsQueueType::const_iterator itr_team[BG_TEAMS_COUNT];
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
{
|
||||
itr_team[i] = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].begin();
|
||||
for(; itr_team[i] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++(itr_team[i]))
|
||||
for (; itr_team[i] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + i].end(); ++(itr_team[i]))
|
||||
{
|
||||
if (!(*(itr_team[i]))->IsInvitedToBGInstanceGUID)
|
||||
{
|
||||
@@ -666,7 +666,7 @@ bool BattleGroundQueue::CheckNormalMatch(BattleGround* bg_template, BGQueueIdBas
|
||||
{
|
||||
//we will try to invite more groups to team with less players indexed by j
|
||||
++(itr_team[j]); //this will not cause a crash, because for cycle above reached break;
|
||||
for(; itr_team[j] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
|
||||
for (; itr_team[j] != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + j].end(); ++(itr_team[j]))
|
||||
{
|
||||
if (!(*(itr_team[j]))->IsInvitedToBGInstanceGUID)
|
||||
if (!m_SelectionPools[j].AddGroup(*(itr_team[j]), m_SelectionPools[(j + 1) % BG_TEAMS_COUNT].GetPlayerCount()))
|
||||
@@ -703,7 +703,7 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_
|
||||
GroupQueueInfo* ginfo = m_SelectionPools[teamIndex].SelectedGroups.back();
|
||||
//set itr_team to group that was added to selection pool latest
|
||||
GroupsQueueType::iterator itr_team = m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].begin();
|
||||
for(; itr_team != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team)
|
||||
for (; itr_team != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team)
|
||||
if (ginfo == *itr_team)
|
||||
break;
|
||||
if (itr_team == m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end())
|
||||
@@ -711,7 +711,7 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_
|
||||
GroupsQueueType::iterator itr_team2 = itr_team;
|
||||
++itr_team2;
|
||||
//invite players to other selection pool
|
||||
for(; itr_team2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team2)
|
||||
for (; itr_team2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr_team2)
|
||||
{
|
||||
//if selection pool is full then break;
|
||||
if (!(*itr_team2)->IsInvitedToBGInstanceGUID && !m_SelectionPools[otherTeam].AddGroup(*itr_team2, minPlayersPerTeam))
|
||||
@@ -721,7 +721,7 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_
|
||||
return false;
|
||||
|
||||
//here we have correct 2 selections and we need to change one teams team and move selection pool teams to other team's queue
|
||||
for(GroupsQueueType::iterator itr = m_SelectionPools[otherTeam].SelectedGroups.begin(); itr != m_SelectionPools[otherTeam].SelectedGroups.end(); ++itr)
|
||||
for (GroupsQueueType::iterator itr = m_SelectionPools[otherTeam].SelectedGroups.begin(); itr != m_SelectionPools[otherTeam].SelectedGroups.end(); ++itr)
|
||||
{
|
||||
//set correct team
|
||||
(*itr)->Team = otherTeamId;
|
||||
@@ -730,7 +730,7 @@ bool BattleGroundQueue::CheckSkirmishForSameFaction(BGQueueIdBasedOnLevel queue_
|
||||
//remove team from old queue
|
||||
GroupsQueueType::iterator itr2 = itr_team;
|
||||
++itr2;
|
||||
for(; itr2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr2)
|
||||
for (; itr2 != m_QueuedGroups[queue_id][BG_QUEUE_NORMAL_ALLIANCE + teamIndex].end(); ++itr2)
|
||||
{
|
||||
if (*itr2 == *itr)
|
||||
{
|
||||
@@ -778,9 +778,9 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
FillPlayersToBG(bg, queue_id);
|
||||
|
||||
// now everything is set, invite players
|
||||
for(GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.end(); ++citr)
|
||||
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE].SelectedGroups.end(); ++citr)
|
||||
InviteGroupToBG((*citr), bg, (*citr)->Team);
|
||||
for(GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.end(); ++citr)
|
||||
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_HORDE].SelectedGroups.end(); ++citr)
|
||||
InviteGroupToBG((*citr), bg, (*citr)->Team);
|
||||
|
||||
if (!bg->HasFreeSlots())
|
||||
@@ -850,8 +850,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
return;
|
||||
}
|
||||
//invite those selection pools
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for(GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
|
||||
InviteGroupToBG((*citr), bg2, (*citr)->Team);
|
||||
//start bg
|
||||
bg2->StartBattleGround();
|
||||
@@ -877,8 +877,8 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
}
|
||||
|
||||
// invite those selection pools
|
||||
for(uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for(GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
|
||||
for (uint32 i = 0; i < BG_TEAMS_COUNT; i++)
|
||||
for (GroupsQueueType::const_iterator citr = m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.begin(); citr != m_SelectionPools[BG_TEAM_ALLIANCE + i].SelectedGroups.end(); ++citr)
|
||||
InviteGroupToBG((*citr), bg2, (*citr)->Team);
|
||||
// start bg
|
||||
bg2->StartBattleGround();
|
||||
@@ -927,11 +927,11 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
|
||||
//optimalization : --- we dont need to use selection_pools - each update we select max 2 groups
|
||||
|
||||
for(uint32 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; i++)
|
||||
for (uint32 i = BG_QUEUE_PREMADE_ALLIANCE; i < BG_QUEUE_NORMAL_ALLIANCE; i++)
|
||||
{
|
||||
// take the group that joined first
|
||||
itr_team[i] = m_QueuedGroups[queue_id][i].begin();
|
||||
for(; itr_team[i] != m_QueuedGroups[queue_id][i].end(); ++(itr_team[i]))
|
||||
for (; itr_team[i] != m_QueuedGroups[queue_id][i].end(); ++(itr_team[i]))
|
||||
{
|
||||
// if group match conditions, then add it to pool
|
||||
if( !(*itr_team[i])->IsInvitedToBGInstanceGUID
|
||||
@@ -952,7 +952,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
{
|
||||
itr_team[BG_TEAM_ALLIANCE] = itr_team[BG_TEAM_HORDE];
|
||||
++itr_team[BG_TEAM_ALLIANCE];
|
||||
for(; itr_team[BG_TEAM_ALLIANCE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++(itr_team[BG_TEAM_ALLIANCE]))
|
||||
for (; itr_team[BG_TEAM_ALLIANCE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_HORDE].end(); ++(itr_team[BG_TEAM_ALLIANCE]))
|
||||
{
|
||||
if( !(*itr_team[BG_TEAM_ALLIANCE])->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_ALLIANCE])->ArenaTeamRating <= arenaMaxRating)
|
||||
@@ -968,7 +968,7 @@ void BattleGroundQueue::Update(BattleGroundTypeId bgTypeId, BGQueueIdBasedOnLeve
|
||||
{
|
||||
itr_team[BG_TEAM_HORDE] = itr_team[BG_TEAM_ALLIANCE];
|
||||
++itr_team[BG_TEAM_HORDE];
|
||||
for(; itr_team[BG_TEAM_HORDE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++(itr_team[BG_TEAM_HORDE]))
|
||||
for (; itr_team[BG_TEAM_HORDE] != m_QueuedGroups[queue_id][BG_QUEUE_PREMADE_ALLIANCE].end(); ++(itr_team[BG_TEAM_HORDE]))
|
||||
{
|
||||
if( !(*itr_team[BG_TEAM_HORDE])->IsInvitedToBGInstanceGUID
|
||||
&& (((*itr_team[BG_TEAM_HORDE])->ArenaTeamRating >= arenaMinRating && (*itr_team[BG_TEAM_HORDE])->ArenaTeamRating <= arenaMaxRating)
|
||||
@@ -1119,7 +1119,7 @@ void BGQueueRemoveEvent::Abort(uint64 /*e_time*/)
|
||||
|
||||
BattleGroundMgr::BattleGroundMgr() : m_AutoDistributionTimeChecker(0), m_ArenaTesting(false)
|
||||
{
|
||||
for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
m_BattleGrounds[i].clear();
|
||||
m_NextRatingDiscardUpdate = sWorld.getConfig(CONFIG_ARENA_RATING_DISCARD_TIMER);
|
||||
m_Testing=false;
|
||||
@@ -1132,9 +1132,9 @@ BattleGroundMgr::~BattleGroundMgr()
|
||||
|
||||
void BattleGroundMgr::DeleteAllBattleGrounds()
|
||||
{
|
||||
for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
{
|
||||
for(BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end();)
|
||||
for (BattleGroundSet::iterator itr = m_BattleGrounds[i].begin(); itr != m_BattleGrounds[i].end(); )
|
||||
{
|
||||
BattleGround * bg = itr->second;
|
||||
m_BattleGrounds[i].erase(itr++);
|
||||
@@ -1145,7 +1145,7 @@ void BattleGroundMgr::DeleteAllBattleGrounds()
|
||||
}
|
||||
|
||||
// destroy template battlegrounds that listed only in queues (other already terminated)
|
||||
for(uint32 bgTypeId = 0; bgTypeId < MAX_BATTLEGROUND_TYPE_ID; ++bgTypeId)
|
||||
for (uint32 bgTypeId = 0; bgTypeId < MAX_BATTLEGROUND_TYPE_ID; ++bgTypeId)
|
||||
{
|
||||
// ~BattleGround call unregistring BG from queue
|
||||
while(!BGFreeSlotQueue[bgTypeId].empty())
|
||||
@@ -1157,13 +1157,13 @@ void BattleGroundMgr::DeleteAllBattleGrounds()
|
||||
void BattleGroundMgr::Update(uint32 diff)
|
||||
{
|
||||
BattleGroundSet::iterator itr, next;
|
||||
for(uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
for (uint32 i = BATTLEGROUND_TYPE_NONE; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
{
|
||||
itr = m_BattleGrounds[i].begin();
|
||||
// skip updating battleground template
|
||||
if (itr != m_BattleGrounds[i].end())
|
||||
++itr;
|
||||
for(; itr != m_BattleGrounds[i].end(); itr = next)
|
||||
for (; itr != m_BattleGrounds[i].end(); itr = next)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
@@ -1339,14 +1339,14 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
|
||||
if(type) // arena
|
||||
{
|
||||
// it seems this must be according to BG_WINNER_A/H and _NOT_ BG_TEAM_A/H
|
||||
for(int i = 1; i >= 0; --i)
|
||||
for (int i = 1; i >= 0; --i)
|
||||
{
|
||||
*data << uint32(bg->m_ArenaTeamRatingChanges[i]);
|
||||
*data << uint32(3999); // huge thanks for TOM_RUS for this!
|
||||
*data << uint32(0); // added again in 3.1
|
||||
sLog.outDebug("rating change: %d", bg->m_ArenaTeamRatingChanges[i]);
|
||||
}
|
||||
for(int i = 1; i >= 0; --i)
|
||||
for (int i = 1; i >= 0; --i)
|
||||
{
|
||||
uint32 at_id = bg->m_ArenaTeamIds[i];
|
||||
ArenaTeam * at = objmgr.GetArenaTeamById(at_id);
|
||||
@@ -1369,7 +1369,7 @@ void BattleGroundMgr::BuildPvpLogDataPacket(WorldPacket *data, BattleGround *bg)
|
||||
|
||||
*data << (int32)(bg->GetPlayerScoresSize());
|
||||
|
||||
for(BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
|
||||
for (BattleGround::BattleGroundScoreMap::const_iterator itr = bg->GetPlayerScoresBegin(); itr != bg->GetPlayerScoresEnd(); ++itr)
|
||||
{
|
||||
*data << (uint64)itr->first;
|
||||
*data << (int32)itr->second->KillingBlows;
|
||||
@@ -1484,7 +1484,7 @@ BattleGround * BattleGroundMgr::GetBattleGroundThroughClientInstance(uint32 inst
|
||||
if (bg->isArena())
|
||||
return GetBattleGround(instanceId, bgTypeId);
|
||||
|
||||
for(BattleGroundSet::iterator itr = m_BattleGrounds[bgTypeId].begin(); itr != m_BattleGrounds[bgTypeId].end(); ++itr)
|
||||
for (BattleGroundSet::iterator itr = m_BattleGrounds[bgTypeId].begin(); itr != m_BattleGrounds[bgTypeId].end(); ++itr)
|
||||
{
|
||||
if (itr->second->GetClientInstanceID() == instanceId)
|
||||
return itr->second;
|
||||
@@ -1500,7 +1500,7 @@ BattleGround * BattleGroundMgr::GetBattleGround(uint32 InstanceID, BattleGroundT
|
||||
BattleGroundSet::iterator itr;
|
||||
if (bgTypeId == BATTLEGROUND_TYPE_NONE)
|
||||
{
|
||||
for(uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
for (uint32 i = BATTLEGROUND_AV; i < MAX_BATTLEGROUND_TYPE_ID; i++)
|
||||
{
|
||||
itr = m_BattleGrounds[i].find(InstanceID);
|
||||
if (itr != m_BattleGrounds[i].end())
|
||||
@@ -1530,7 +1530,7 @@ uint32 BattleGroundMgr::CreateClientVisibleInstanceId(BattleGroundTypeId bgTypeI
|
||||
// the following works, because std::set is default ordered with "<"
|
||||
// the optimalization would be to use as bitmask std::vector<uint32> - but that would only make code unreadable
|
||||
uint32 lastId = 0;
|
||||
for(std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end();)
|
||||
for (std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end(); )
|
||||
{
|
||||
if( (++lastId) != *itr) //if there is a gap between the ids, we will break..
|
||||
break;
|
||||
@@ -1816,7 +1816,7 @@ void BattleGroundMgr::DistributeArenaPoints()
|
||||
std::map<uint32, uint32> PlayerPoints;
|
||||
|
||||
//at first update all points for all team members
|
||||
for(ObjectMgr::ArenaTeamMap::iterator team_itr = objmgr.GetArenaTeamMapBegin(); team_itr != objmgr.GetArenaTeamMapEnd(); ++team_itr)
|
||||
for (ObjectMgr::ArenaTeamMap::iterator team_itr = objmgr.GetArenaTeamMapBegin(); team_itr != objmgr.GetArenaTeamMapEnd(); ++team_itr)
|
||||
if (ArenaTeam * at = team_itr->second)
|
||||
at->UpdateArenaPointsHelper(PlayerPoints);
|
||||
|
||||
@@ -1843,7 +1843,7 @@ void BattleGroundMgr::DistributeArenaPoints()
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_ONLINE_END);
|
||||
|
||||
sWorld.SendWorldText(LANG_DIST_ARENA_POINTS_TEAM_START);
|
||||
for(ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
|
||||
for (ObjectMgr::ArenaTeamMap::iterator titr = objmgr.GetArenaTeamMapBegin(); titr != objmgr.GetArenaTeamMapEnd(); ++titr)
|
||||
{
|
||||
if (ArenaTeam * at = titr->second)
|
||||
{
|
||||
@@ -1884,7 +1884,7 @@ void BattleGroundMgr::BuildBattleGroundListPacket(WorldPacket *data, const uint6
|
||||
*data << uint32(0x00); // number of bg instances
|
||||
|
||||
uint32 queue_id = plr->GetBattleGroundQueueIdFromLevel(bgTypeId);
|
||||
for(std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end();++itr)
|
||||
for (std::set<uint32>::iterator itr = m_ClientBattleGroundIds[bgTypeId][queue_id].begin(); itr != m_ClientBattleGroundIds[bgTypeId][queue_id].end(); ++itr)
|
||||
{
|
||||
*data << uint32(*itr);
|
||||
++count;
|
||||
@@ -2026,7 +2026,7 @@ void BattleGroundMgr::ToggleArenaTesting()
|
||||
|
||||
void BattleGroundMgr::SetHolidayWeekends(uint32 mask)
|
||||
{
|
||||
for(uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
|
||||
for (uint32 bgtype = 1; bgtype < MAX_BATTLEGROUND_TYPE_ID; ++bgtype)
|
||||
{
|
||||
if(BattleGround * bg = GetBattleGroundTemplate(BattleGroundTypeId(bgtype)))
|
||||
{
|
||||
|
||||
@@ -58,16 +58,16 @@ void BattleGroundNA::Update(uint32 diff)
|
||||
|
||||
void BattleGroundNA::StartingEventCloseDoors()
|
||||
{
|
||||
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; ++i)
|
||||
for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_4; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundNA::StartingEventOpenDoors()
|
||||
{
|
||||
for(uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; ++i)
|
||||
for (uint32 i = BG_NA_OBJECT_DOOR_1; i <= BG_NA_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
|
||||
for(uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; ++i)
|
||||
for (uint32 i = BG_NA_OBJECT_BUFF_1; i <= BG_NA_OBJECT_BUFF_2; ++i)
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundRL.h"
|
||||
#include "Language.h"
|
||||
@@ -59,16 +58,16 @@ void BattleGroundRL::Update(uint32 diff)
|
||||
|
||||
void BattleGroundRL::StartingEventCloseDoors()
|
||||
{
|
||||
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
for (uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
void BattleGroundRL::StartingEventOpenDoors()
|
||||
{
|
||||
for(uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
for (uint32 i = BG_RL_OBJECT_DOOR_1; i <= BG_RL_OBJECT_DOOR_2; ++i)
|
||||
DoorOpen(i);
|
||||
|
||||
for(uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; ++i)
|
||||
for (uint32 i = BG_RL_OBJECT_BUFF_1; i <= BG_RL_OBJECT_BUFF_2; ++i)
|
||||
SpawnBGObject(i, 60);
|
||||
}
|
||||
|
||||
|
||||
@@ -148,20 +148,20 @@ void BattleGroundWS::Update(uint32 diff)
|
||||
|
||||
void BattleGroundWS::StartingEventCloseDoors()
|
||||
{
|
||||
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i)
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i)
|
||||
{
|
||||
DoorClose(i);
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
|
||||
for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_ONE_DAY);
|
||||
}
|
||||
|
||||
void BattleGroundWS::StartingEventOpenDoors()
|
||||
{
|
||||
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; ++i)
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_A_4; ++i)
|
||||
DoorOpen(i);
|
||||
for(uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; ++i)
|
||||
for (uint32 i = BG_WS_OBJECT_DOOR_H_1; i <= BG_WS_OBJECT_DOOR_H_2; ++i)
|
||||
DoorOpen(i);
|
||||
|
||||
SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_ONE_DAY);
|
||||
@@ -169,7 +169,7 @@ void BattleGroundWS::StartingEventOpenDoors()
|
||||
SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_ONE_DAY);
|
||||
SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_ONE_DAY);
|
||||
|
||||
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
|
||||
for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
|
||||
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ void WorldSession::HandleCalendarGetCalendar(WorldPacket &recv_data)
|
||||
size_t p_counter = data.wpos();
|
||||
data << uint32(counter); // instance save count
|
||||
|
||||
for(int i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (int i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
for (Player::BoundInstancesMap::const_iterator itr = _player->m_boundInstances[i].begin(); itr != _player->m_boundInstances[i].end(); ++itr)
|
||||
{
|
||||
@@ -119,7 +119,7 @@ void WorldSession::HandleCalendarAddEvent(WorldPacket &recv_data)
|
||||
// {
|
||||
// uint8 unk12,unk13;
|
||||
// uint64 guid;
|
||||
// for (int i=0;i<count;i++)
|
||||
// for (int i=0; i<count; i++)
|
||||
// {
|
||||
// recv_data.readPackGUID(guid);
|
||||
// recv_data >> (uint8)unk12;
|
||||
|
||||
+4
-5
@@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL CellArea
|
||||
CellArea() : right_offset(0), left_offset(0), upper_offset(0), lower_offset(0) {}
|
||||
CellArea(int right, int left, int upper, int lower) : right_offset(right), left_offset(left), upper_offset(upper), lower_offset(lower) {}
|
||||
bool operator!() const { return !right_offset && !left_offset && !upper_offset && !lower_offset; }
|
||||
|
||||
|
||||
void ResizeBorders(CellPair& begin_cell, CellPair& end_cell) const
|
||||
{
|
||||
begin_cell << left_offset;
|
||||
@@ -60,13 +60,12 @@ struct TRINITY_DLL_DECL CellArea
|
||||
end_cell >> right_offset;
|
||||
end_cell += upper_offset;
|
||||
}
|
||||
|
||||
|
||||
int right_offset;
|
||||
int left_offset;
|
||||
int upper_offset;
|
||||
int lower_offset;
|
||||
};
|
||||
|
||||
|
||||
struct TRINITY_DLL_DECL Cell
|
||||
{
|
||||
@@ -168,9 +167,9 @@ struct TRINITY_DLL_DECL Cell
|
||||
template<class LOCK_TYPE, class T, class CONTAINER> void Visit(const CellLock<LOCK_TYPE> &, TypeContainerVisitor<T, CONTAINER> &visitor, Map &) const;
|
||||
template<class LOCK_TYPE, class T, class CONTAINER> void Visit(const CellLock<LOCK_TYPE> &, TypeContainerVisitor<T, CONTAINER> &visitor, Map &m, const WorldObject &obj, float radius) const;
|
||||
template<class LOCK_TYPE, class T, class CONTAINER> void Visit(const CellLock<LOCK_TYPE> &, TypeContainerVisitor<T, CONTAINER> &visitor, Map &, float radius, float x_off, float y_off) const;
|
||||
|
||||
|
||||
static CellArea CalculateCellArea(const WorldObject &obj, float radius);
|
||||
|
||||
|
||||
private:
|
||||
template<class LOCK_TYPE, class T, class CONTAINER> void VisitCircle(const CellLock<LOCK_TYPE> &, TypeContainerVisitor<T, CONTAINER> &, Map &, const CellPair& , const CellPair& ) const;
|
||||
};
|
||||
|
||||
+27
-27
@@ -119,9 +119,9 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
}
|
||||
|
||||
// loop the cell range
|
||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
Cell r_zone(cell_pair);
|
||||
@@ -167,9 +167,9 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
end_cell += upper;
|
||||
|
||||
// loop the cell range
|
||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
Cell r_zone(cell_pair);
|
||||
@@ -184,15 +184,15 @@ inline int CellHelper(const float radius)
|
||||
{
|
||||
if(radius < 1.0f)
|
||||
return 0;
|
||||
|
||||
|
||||
return (int)ceilf(radius/SIZE_OF_GRID_CELL);
|
||||
}
|
||||
|
||||
|
||||
inline CellArea Cell::CalculateCellArea(const WorldObject &obj, float radius)
|
||||
{
|
||||
if(radius <= 0.0f)
|
||||
return CellArea();
|
||||
|
||||
|
||||
//we should increase search radius by object's radius, otherwise
|
||||
//we could have problems with huge creatures, which won't attack nearest players etc
|
||||
radius += obj.GetObjectSize();
|
||||
@@ -200,23 +200,23 @@ inline CellArea Cell::CalculateCellArea(const WorldObject &obj, float radius)
|
||||
//TODO: add more correct/generic method for this task
|
||||
const float x_offset = (obj.GetPositionX() - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL;
|
||||
const float y_offset = (obj.GetPositionY() - CENTER_GRID_CELL_OFFSET)/SIZE_OF_GRID_CELL;
|
||||
|
||||
|
||||
const float x_val = floor(x_offset + CENTER_GRID_CELL_ID + 0.5f);
|
||||
const float y_val = floor(y_offset + CENTER_GRID_CELL_ID + 0.5f);
|
||||
|
||||
|
||||
const float x_off = (x_offset - x_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
|
||||
const float y_off = (y_offset - y_val + CENTER_GRID_CELL_ID) * SIZE_OF_GRID_CELL;
|
||||
|
||||
|
||||
const float tmp_diff = radius - CENTER_GRID_CELL_OFFSET;
|
||||
//lets calculate upper/lower/right/left corners for cell search
|
||||
int right = CellHelper(tmp_diff + x_off);
|
||||
int left = CellHelper(tmp_diff - x_off);
|
||||
int upper = CellHelper(tmp_diff + y_off);
|
||||
int lower = CellHelper(tmp_diff - y_off);
|
||||
|
||||
|
||||
return CellArea(right, left, upper, lower);
|
||||
}
|
||||
|
||||
|
||||
template<class LOCK_TYPE, class T, class CONTAINER>
|
||||
inline void
|
||||
Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &visitor, Map &m, const WorldObject &obj, float radius) const
|
||||
@@ -224,7 +224,7 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
const CellPair &standing_cell = l.i_cellPair;
|
||||
if (standing_cell.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || standing_cell.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP)
|
||||
return;
|
||||
|
||||
|
||||
//no jokes here... Actually placing ASSERT() here was good idea, but
|
||||
//we had some problems with DynamicObjects, which pass radius = 0.0f (DB issue?)
|
||||
//maybe it is better to just return when radius <= 0.0f?
|
||||
@@ -236,7 +236,7 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
//lets limit the upper value for search radius
|
||||
if(radius > 333.0f)
|
||||
radius = 333.0f;
|
||||
|
||||
|
||||
//lets calculate object coord offsets from cell borders.
|
||||
CellArea area = Cell::CalculateCellArea(obj, radius);
|
||||
//if radius fits inside standing cell
|
||||
@@ -245,10 +245,10 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
m.Visit(l, visitor);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
CellPair begin_cell = standing_cell;
|
||||
CellPair end_cell = standing_cell;
|
||||
|
||||
|
||||
area.ResizeBorders(begin_cell, end_cell);
|
||||
//visit all cells, found in CalculateCellArea()
|
||||
//if radius is known to reach cell area more than 4x4 then we should call optimized VisitCircle
|
||||
@@ -259,15 +259,15 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
VisitCircle(l, visitor, m, begin_cell, end_cell);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
//ALWAYS visit standing cell first!!! Since we deal with small radiuses
|
||||
//it is very essential to call visitor for standing cell firstly...
|
||||
m.Visit(l, visitor);
|
||||
|
||||
|
||||
// loop the cell range
|
||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; x++)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; y++)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
//lets skip standing cell since we already visited it
|
||||
@@ -281,7 +281,7 @@ Cell::Visit(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &vi
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class LOCK_TYPE, class T, class CONTAINER>
|
||||
inline void
|
||||
Cell::VisitCircle(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINER> &visitor, Map &m, const CellPair& begin_cell, const CellPair& end_cell) const
|
||||
@@ -291,11 +291,11 @@ Cell::VisitCircle(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINE
|
||||
//lets calculate x_start/x_end coords for central strip...
|
||||
const uint32 x_start = begin_cell.x_coord + x_shift;
|
||||
const uint32 x_end = end_cell.x_coord - x_shift;
|
||||
|
||||
|
||||
//visit central strip with constant width...
|
||||
for(uint32 x = x_start; x <= x_end; ++x)
|
||||
for (uint32 x = x_start; x <= x_end; ++x)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
{
|
||||
CellPair cell_pair(x,y);
|
||||
Cell r_zone(cell_pair);
|
||||
@@ -304,12 +304,12 @@ Cell::VisitCircle(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINE
|
||||
m.Visit(lock, visitor);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//if x_shift == 0 then we have too small cell area, which were already
|
||||
//visited at previous step, so just return from procedure...
|
||||
if(x_shift == 0)
|
||||
return;
|
||||
|
||||
|
||||
uint32 y_start = end_cell.y_coord;
|
||||
uint32 y_end = begin_cell.y_coord;
|
||||
//now we are visiting borders of an octagon...
|
||||
@@ -327,7 +327,7 @@ Cell::VisitCircle(const CellLock<LOCK_TYPE> &l, TypeContainerVisitor<T, CONTAINE
|
||||
r_zone_left.data.Part.nocreate = l->data.Part.nocreate;
|
||||
CellLock<LOCK_TYPE> lock_left(r_zone_left, cell_pair_left);
|
||||
m.Visit(lock_left, visitor);
|
||||
|
||||
|
||||
//right trapezoid cell visit
|
||||
CellPair cell_pair_right(x_end + step, y);
|
||||
Cell r_zone_right(cell_pair_right);
|
||||
|
||||
+16
-16
@@ -46,7 +46,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
m_flags |= CHANNEL_FLAG_LFG;
|
||||
else // for all other channels
|
||||
m_flags |= CHANNEL_FLAG_NOT_LFG;
|
||||
m_IsSaved = false;
|
||||
m_IsSaved = false;
|
||||
}
|
||||
else // it's custom channel
|
||||
{
|
||||
@@ -62,14 +62,14 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
m_moderate = fields[3].GetBool();
|
||||
m_password = fields[4].GetString();
|
||||
const char* db_BannedList = fields[5].GetString();
|
||||
|
||||
|
||||
m_IsSaved = true;
|
||||
|
||||
if(db_BannedList)
|
||||
{
|
||||
Tokens tokens = StrSplit(db_BannedList, " ");
|
||||
Tokens::iterator iter;
|
||||
for (iter = tokens.begin();iter != tokens.end(); ++iter)
|
||||
for (iter = tokens.begin(); iter != tokens.end(); ++iter)
|
||||
{
|
||||
uint64 banned_guid = atol((*iter).c_str());
|
||||
if(banned_guid)
|
||||
@@ -87,7 +87,7 @@ Channel::Channel(const std::string& name, uint32 channel_id, uint32 Team)
|
||||
{
|
||||
sLog.outDebug("New Channel(%s) saved", name.c_str());
|
||||
m_IsSaved = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ void Channel::Join(uint64 p, const char *pass)
|
||||
if(!IsConstant() && !m_ownerGUID)
|
||||
{
|
||||
SetOwner(p, (players.size() > 1 ? true : false));
|
||||
players[p].SetModerator(true);
|
||||
players[p].SetModerator(true);
|
||||
}
|
||||
/*
|
||||
else if(!IsConstant() && m_ownerGUID && plr && m_ownerGUID == plr->GetGUID() ))
|
||||
@@ -265,7 +265,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
{
|
||||
std::ostringstream banlist;
|
||||
BannedList::iterator iter;
|
||||
for (iter = banned.begin();iter != banned.end(); ++iter)
|
||||
for (iter = banned.begin(); iter != banned.end(); ++iter)
|
||||
{
|
||||
banlist << (*iter) << " ";
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void Channel::KickOrBan(uint64 good, const char *badname, bool ban)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) BannedList saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -335,7 +335,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
||||
{
|
||||
std::ostringstream banlist;
|
||||
BannedList::iterator iter;
|
||||
for (iter = banned.begin();iter != banned.end(); ++iter)
|
||||
for (iter = banned.begin(); iter != banned.end(); ++iter)
|
||||
{
|
||||
banlist << (*iter) << " ";
|
||||
}
|
||||
@@ -344,7 +344,7 @@ void Channel::UnBan(uint64 good, const char *badname)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) BannedList saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -383,7 +383,7 @@ void Channel::Password(uint64 p, const char *pass)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) password saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -541,7 +541,7 @@ void Channel::List(Player* player)
|
||||
uint32 gmLevelInWhoList = sWorld.getConfig(CONFIG_GM_LEVEL_IN_WHO_LIST);
|
||||
|
||||
uint32 count = 0;
|
||||
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(i->first);
|
||||
|
||||
@@ -598,7 +598,7 @@ void Channel::Announce(uint64 p)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) announce saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -640,7 +640,7 @@ void Channel::Moderate(uint64 p)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) moderate saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -777,7 +777,7 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
|
||||
if(CharacterDatabase.PExecute( ss.str( ).c_str( ) ))
|
||||
{
|
||||
sLog.outDebug("Channel(%s) owner saved", m_name.c_str());
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -785,7 +785,7 @@ void Channel::SetOwner(uint64 guid, bool exclaim)
|
||||
|
||||
void Channel::SendToAll(WorldPacket *data, uint64 p)
|
||||
{
|
||||
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
Player *plr = objmgr.GetPlayer(i->first);
|
||||
if(plr)
|
||||
@@ -798,7 +798,7 @@ void Channel::SendToAll(WorldPacket *data, uint64 p)
|
||||
|
||||
void Channel::SendToAllButOne(WorldPacket *data, uint64 who)
|
||||
{
|
||||
for(PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
for (PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
{
|
||||
if(i->first != who)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
|
||||
#include "Policies/SingletonImp.h"
|
||||
|
||||
#include "ObjectMgr.h" // for normalizePlayerName
|
||||
|
||||
@@ -38,7 +38,7 @@ ChannelMgr* channelMgr(uint32 team)
|
||||
|
||||
ChannelMgr::~ChannelMgr()
|
||||
{
|
||||
for(ChannelMap::iterator itr = channels.begin();itr!=channels.end(); ++itr)
|
||||
for (ChannelMap::iterator itr = channels.begin(); itr!=channels.end(); ++itr)
|
||||
delete itr->second;
|
||||
|
||||
channels.clear();
|
||||
|
||||
@@ -443,7 +443,7 @@ void WorldSession::HandleCharCreateOpcode( WorldPacket & recv_data )
|
||||
recv_data >> hairColor;
|
||||
recv_data >> facialHair;
|
||||
recv_data >> outfitId;
|
||||
|
||||
|
||||
if(recv_data.rpos() < recv_data.wpos())
|
||||
{
|
||||
uint8 unk;
|
||||
@@ -846,7 +846,7 @@ void WorldSession::HandleSetFactionCheat( WorldPacket & /*recv_data*/ )
|
||||
|
||||
std::list<struct Factions>::iterator itr;
|
||||
|
||||
for(itr = GetPlayer()->factions.begin(); itr != GetPlayer()->factions.end(); ++itr)
|
||||
for (itr = GetPlayer()->factions.begin(); itr != GetPlayer()->factions.end(); ++itr)
|
||||
{
|
||||
if(itr->ReputationListID == FactionID)
|
||||
{
|
||||
@@ -1060,7 +1060,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
{
|
||||
recv_data >> declinedname.name[i];
|
||||
if(!normalizePlayerName(declinedname.name[i]))
|
||||
@@ -1082,7 +1082,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
for(int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
for (int i = 0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
CharacterDatabase.escape_string(declinedname.name[i]);
|
||||
|
||||
CharacterDatabase.BeginTransaction();
|
||||
@@ -1288,7 +1288,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPacket &recv_data)
|
||||
eqSet.IconName = iconName;
|
||||
eqSet.state = EQUIPMENT_SET_NEW;
|
||||
|
||||
for(uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
uint64 itemGuid;
|
||||
if(!recv_data.readPackGUID(itemGuid))
|
||||
@@ -1324,7 +1324,7 @@ void WorldSession::HandleEquipmentSetUse(WorldPacket &recv_data)
|
||||
sLog.outDebug("CMSG_EQUIPMENT_SET_USE");
|
||||
recv_data.hexlike();
|
||||
|
||||
for(uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
for (uint32 i = 0; i < EQUIPMENT_SLOT_END; ++i)
|
||||
{
|
||||
uint64 itemGuid;
|
||||
if(!recv_data.readPackGUID(itemGuid))
|
||||
|
||||
+2
-2
@@ -825,7 +825,7 @@ bool ChatHandler::hasStringAbbr(const char* name, const char* part)
|
||||
if (!*part)
|
||||
return false;
|
||||
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
if (!*part)
|
||||
return true;
|
||||
@@ -2373,4 +2373,4 @@ LocaleConstant CliHandler::GetSessionDbcLocale() const
|
||||
int CliHandler::GetSessionDbLocaleIndex() const
|
||||
{
|
||||
return objmgr.GetDBCLocaleIndex();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,6 @@ class TRINITY_DLL_SPEC ChatHandler
|
||||
bool HasLowerSecurity(Player* target, uint64 guid, bool strong = false);
|
||||
bool HasLowerSecurityAccount(WorldSession* target, uint32 account, bool strong = false);
|
||||
|
||||
|
||||
void SendGlobalGMSysMessage(const char *str);
|
||||
|
||||
static bool SetDataForCommandInTable(ChatCommand *table, const char* text, uint32 security, std::string const& help, std::string const& fullcommand );
|
||||
|
||||
@@ -90,7 +90,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||
// also check SPELL_AURA_COMPREHEND_LANGUAGE (client offers option to speak in that language)
|
||||
Unit::AuraEffectList const& langAuras = _player->GetAurasByType(SPELL_AURA_COMPREHEND_LANGUAGE);
|
||||
bool foundAura = false;
|
||||
for(Unit::AuraEffectList::const_iterator i = langAuras.begin();i != langAuras.end(); ++i)
|
||||
for (Unit::AuraEffectList::const_iterator i = langAuras.begin(); i != langAuras.end(); ++i)
|
||||
{
|
||||
if((*i)->GetMiscValue() == int32(lang))
|
||||
{
|
||||
|
||||
@@ -56,7 +56,7 @@ int TurretAI::Permissible(const Creature *creature)
|
||||
|
||||
void CombatAI::InitializeAI()
|
||||
{
|
||||
for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
if(me->m_spells[i] && GetSpellStore()->LookupEntry(me->m_spells[i]))
|
||||
spells.push_back(me->m_spells[i]);
|
||||
|
||||
@@ -70,14 +70,14 @@ void CombatAI::Reset()
|
||||
|
||||
void CombatAI::JustDied(Unit *killer)
|
||||
{
|
||||
for(SpellVct::iterator i = spells.begin(); i != spells.end(); ++i)
|
||||
for (SpellVct::iterator i = spells.begin(); i != spells.end(); ++i)
|
||||
if(AISpellInfo[*i].condition == AICOND_DIE)
|
||||
me->CastSpell(killer, *i, true);
|
||||
}
|
||||
|
||||
void CombatAI::EnterCombat(Unit *who)
|
||||
{
|
||||
for(SpellVct::iterator i = spells.begin(); i != spells.end(); ++i)
|
||||
for (SpellVct::iterator i = spells.begin(); i != spells.end(); ++i)
|
||||
{
|
||||
if(AISpellInfo[*i].condition == AICOND_AGGRO)
|
||||
me->CastSpell(who, *i, false);
|
||||
@@ -105,7 +105,6 @@ void CombatAI::UpdateAI(const uint32 diff)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
/////////////////
|
||||
//CasterAI
|
||||
/////////////////
|
||||
@@ -115,7 +114,7 @@ void CasterAI::InitializeAI()
|
||||
CombatAI::InitializeAI();
|
||||
|
||||
float m_attackDist = 30.0f;
|
||||
for(SpellVct::iterator itr = spells.begin(); itr != spells.end(); ++itr)
|
||||
for (SpellVct::iterator itr = spells.begin(); itr != spells.end(); ++itr)
|
||||
if (AISpellInfo[*itr].condition == AICOND_COMBAT && m_attackDist > GetAISpellInfo(*itr)->maxRange)
|
||||
m_attackDist = GetAISpellInfo(*itr)->maxRange;
|
||||
if (m_attackDist == 30.0f)
|
||||
@@ -129,7 +128,7 @@ void CasterAI::EnterCombat(Unit *who)
|
||||
|
||||
uint32 spell = rand()%spells.size();
|
||||
uint32 count = 0;
|
||||
for(SpellVct::iterator itr = spells.begin(); itr != spells.end(); ++itr, ++count)
|
||||
for (SpellVct::iterator itr = spells.begin(); itr != spells.end(); ++itr, ++count)
|
||||
{
|
||||
if(AISpellInfo[*itr].condition == AICOND_AGGRO)
|
||||
me->CastSpell(who, *itr, false);
|
||||
@@ -164,7 +163,6 @@ void CasterAI::UpdateAI(const uint32 diff)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////
|
||||
//ArchorAI
|
||||
//////////////
|
||||
@@ -210,7 +208,6 @@ void ArchorAI::UpdateAI(const uint32 diff)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
|
||||
//////////////
|
||||
//TurretAI
|
||||
//////////////
|
||||
|
||||
@@ -49,15 +49,15 @@ ConfusedMovementGenerator<T>::Initialize(T &unit)
|
||||
|
||||
VMAP::IVMapManager *vMaps = VMAP::VMapFactory::createOrGetVMapManager();
|
||||
|
||||
for(unsigned int idx=0; idx < MAX_CONF_WAYPOINTS+1; ++idx)
|
||||
for (unsigned int idx=0; idx < MAX_CONF_WAYPOINTS+1; ++idx)
|
||||
{
|
||||
const float wanderX=wander_distance*rand_norm() - wander_distance/2;
|
||||
const float wanderY=wander_distance*rand_norm() - wander_distance/2;
|
||||
|
||||
const bool isInLoS = vMaps->isInLineOfSight(unit.GetMapId(), x, y, z + 2.0f, i_waypoints[idx][0], i_waypoints[idx][1], z + 2.0f);
|
||||
const bool isInLoS = vMaps->isInLineOfSight(unit.GetMapId(), x, y, z + 2.0f, i_waypoints[idx][0], i_waypoints[idx][1], z + 2.0f);
|
||||
if (!isInLoS)
|
||||
{
|
||||
i_waypoints[idx][0] = x;
|
||||
i_waypoints[idx][0] = x;
|
||||
i_waypoints[idx][1] = y;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ void Corpse::SaveToDB()
|
||||
<< GetOrientation() << ", "
|
||||
<< GetZoneId() << ", "
|
||||
<< GetMapId() << ", '";
|
||||
for(uint16 i = 0; i < m_valuesCount; ++i )
|
||||
for (uint16 i = 0; i < m_valuesCount; ++i )
|
||||
ss << GetUInt32Value(i) << " ";
|
||||
ss << "',"
|
||||
<< uint64(m_time) <<", "
|
||||
|
||||
+25
-26
@@ -61,7 +61,7 @@ TrainerSpell const* TrainerSpellData::Find(uint32 spell_id) const
|
||||
|
||||
bool VendorItemData::RemoveItem( uint32 item_id )
|
||||
{
|
||||
for(VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
for (VendorItemList::iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
{
|
||||
if((*i)->item==item_id)
|
||||
{
|
||||
@@ -74,7 +74,7 @@ bool VendorItemData::RemoveItem( uint32 item_id )
|
||||
|
||||
size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||
{
|
||||
for(size_t i = 0; i < m_items.size(); ++i )
|
||||
for (size_t i = 0; i < m_items.size(); ++i )
|
||||
if(m_items[i]->item==item_id)
|
||||
return i;
|
||||
return m_items.size();
|
||||
@@ -82,7 +82,7 @@ size_t VendorItemData::FindItemSlot(uint32 item_id) const
|
||||
|
||||
VendorItem const* VendorItemData::FindItem(uint32 item_id) const
|
||||
{
|
||||
for(VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
for (VendorItemList::const_iterator i = m_items.begin(); i != m_items.end(); ++i )
|
||||
if((*i)->item==item_id)
|
||||
return *i;
|
||||
return NULL;
|
||||
@@ -146,7 +146,7 @@ m_creatureInfo(NULL), m_reactState(REACT_AGGRESSIVE), m_formation(NULL)
|
||||
m_regenTimer = 200;
|
||||
m_valuesCount = UNIT_END;
|
||||
|
||||
for(uint8 i =0; i<CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint8 i =0; i<CREATURE_MAX_SPELLS; ++i)
|
||||
m_spells[i] = 0;
|
||||
|
||||
m_CreatureSpellCooldowns.clear();
|
||||
@@ -334,7 +334,7 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data )
|
||||
if(!m_respawnradius && m_defaultMovementType==RANDOM_MOTION_TYPE)
|
||||
m_defaultMovementType = IDLE_MOTION_TYPE;
|
||||
|
||||
for(uint8 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint8 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
m_spells[i] = GetCreatureInfo()->spells[i];
|
||||
|
||||
return true;
|
||||
@@ -549,7 +549,7 @@ void Creature::Update(uint32 diff)
|
||||
!getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() || // or the victim/owner/charmer is not a player
|
||||
!getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself()->isGameMaster()); // or the victim/owner/charmer is not a GameMaster
|
||||
|
||||
/*if(m_regenTimer <= diff)
|
||||
/*if(m_regenTimer <= diff)
|
||||
{*/
|
||||
if(!bInCombat || bIsPolymorphed) // regenerate health if not in combat or if polymorphed
|
||||
RegenerateHealth();
|
||||
@@ -564,7 +564,7 @@ void Creature::Update(uint32 diff)
|
||||
|
||||
/*if(!bIsPolymorphed) // only increase the timer if not polymorphed
|
||||
m_regenTimer += 2000 - diff;
|
||||
}
|
||||
}
|
||||
else
|
||||
if(!bIsPolymorphed) // if polymorphed, skip the timer
|
||||
m_regenTimer -= diff;*/
|
||||
@@ -682,7 +682,7 @@ bool Creature::AIM_Initialize(CreatureAI* ai)
|
||||
UnitAI *oldAI = i_AI;
|
||||
|
||||
Motion_Initialize();
|
||||
|
||||
|
||||
i_AI = ai ? ai : FactorySelector::selectAI(this);
|
||||
if(oldAI) delete oldAI;
|
||||
IsAIEnabled = true;
|
||||
@@ -695,7 +695,7 @@ void Creature::Motion_Initialize()
|
||||
if(!m_formation)
|
||||
i_motionMaster.Initialize();
|
||||
else if(m_formation->getLeader() == this)
|
||||
{
|
||||
{
|
||||
m_formation->FormationReset(false);
|
||||
i_motionMaster.Initialize();
|
||||
}
|
||||
@@ -894,7 +894,7 @@ void Creature::prepareGossipMenu( Player *pPlayer,uint32 gossipid )
|
||||
// lazy loading single time at use
|
||||
LoadGossipOptions();
|
||||
|
||||
for( GossipOptionList::iterator i = m_goptions.begin( ); i != m_goptions.end( ); ++i )
|
||||
for (GossipOptionList::iterator i = m_goptions.begin( ); i != m_goptions.end( ); ++i )
|
||||
{
|
||||
GossipOption* gso=&*i;
|
||||
if(gso->GossipId == gossipid)
|
||||
@@ -1218,7 +1218,7 @@ uint32 Creature::GetNpcTextId()
|
||||
|
||||
GossipOption const* Creature::GetGossipOption( uint32 id ) const
|
||||
{
|
||||
for( GossipOptionList::const_iterator i = m_goptions.begin( ); i != m_goptions.end( ); ++i )
|
||||
for (GossipOptionList::const_iterator i = m_goptions.begin( ); i != m_goptions.end( ); ++i )
|
||||
{
|
||||
if(i->Action==id )
|
||||
return &*i;
|
||||
@@ -1421,7 +1421,6 @@ void Creature::SelectLevel(const CreatureInfo *cinfo)
|
||||
SetModifierValue(UNIT_MOD_HEALTH, BASE_VALUE, health);
|
||||
SetModifierValue(UNIT_MOD_MANA, BASE_VALUE, mana);
|
||||
|
||||
|
||||
//damage
|
||||
float damagemod = 1.0f;//_GetDamageMod(rank);
|
||||
|
||||
@@ -1607,7 +1606,7 @@ void Creature::LoadEquipment(uint32 equip_entry, bool force)
|
||||
bool Creature::hasQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
return true;
|
||||
@@ -1618,7 +1617,7 @@ bool Creature::hasQuest(uint32 quest_id) const
|
||||
bool Creature::hasInvolvedQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mCreatureQuestInvolvedRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
return true;
|
||||
@@ -1695,7 +1694,7 @@ bool Creature::canStartAttack(Unit const* who, bool force) const
|
||||
{
|
||||
if(isCivilian())
|
||||
return false;
|
||||
|
||||
|
||||
if(!canFly() && (GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE + m_CombatDistance))
|
||||
//|| who->IsControlledByPlayer() && who->IsFlying()))
|
||||
// we cannot check flying for other creatures, too much map/vmap calculation
|
||||
@@ -1784,7 +1783,7 @@ void Creature::setDeathState(DeathState s)
|
||||
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_SKINNABLE);
|
||||
|
||||
SetNoSearchAssistance(false);
|
||||
|
||||
|
||||
//Dismiss group if is leader
|
||||
if(m_formation && m_formation->getLeader() == this)
|
||||
m_formation->FormationReset(true);
|
||||
@@ -1927,7 +1926,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
|
||||
if(!pVictim)
|
||||
return NULL;
|
||||
|
||||
for(uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
if(!m_spells[i])
|
||||
continue;
|
||||
@@ -1939,7 +1938,7 @@ SpellEntry const *Creature::reachWithSpellAttack(Unit *pVictim)
|
||||
}
|
||||
|
||||
bool bcontinue = true;
|
||||
for(uint32 j=0;j<3;j++)
|
||||
for (uint32 j=0; j<3; j++)
|
||||
{
|
||||
if( (spellInfo->Effect[j] == SPELL_EFFECT_SCHOOL_DAMAGE ) ||
|
||||
(spellInfo->Effect[j] == SPELL_EFFECT_INSTAKILL) ||
|
||||
@@ -1977,7 +1976,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
|
||||
if(!pVictim)
|
||||
return NULL;
|
||||
|
||||
for(uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint32 i=0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
if(!m_spells[i])
|
||||
continue;
|
||||
@@ -1989,7 +1988,7 @@ SpellEntry const *Creature::reachWithSpellCure(Unit *pVictim)
|
||||
}
|
||||
|
||||
bool bcontinue = true;
|
||||
for(uint32 j=0;j<3;j++)
|
||||
for (uint32 j=0; j<3; j++)
|
||||
{
|
||||
if( (spellInfo->Effect[j] == SPELL_EFFECT_HEAL ) )
|
||||
{
|
||||
@@ -2221,7 +2220,7 @@ void Creature::SaveRespawnTime()
|
||||
objmgr.SaveCreatureRespawnTime(m_DBTableGuid,GetInstanceId(),time(NULL)+m_respawnDelay+m_deathTimer/IN_MILISECONDS);
|
||||
}
|
||||
|
||||
// this should not be called by petAI or
|
||||
// this should not be called by petAI or
|
||||
bool Creature::canCreatureAttack(Unit const *pVictim, bool force) const
|
||||
{
|
||||
if(!pVictim->IsInMap(this))
|
||||
@@ -2370,7 +2369,7 @@ void Creature::SetInCombatWithZone()
|
||||
if (PlList.isEmpty())
|
||||
return;
|
||||
|
||||
for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if (Player* pPlayer = i->getSource())
|
||||
{
|
||||
@@ -2405,7 +2404,7 @@ void Creature::AddCreatureSpellCooldown(uint32 spellid)
|
||||
uint32 cooldown = GetSpellRecoveryTime(spellInfo);
|
||||
if(Player *modOwner = GetSpellModOwner())
|
||||
modOwner->ApplySpellMod(spellid, SPELLMOD_COOLDOWN, cooldown);
|
||||
|
||||
|
||||
if(cooldown)
|
||||
_AddCreatureSpellCooldown(spellid, time(NULL) + cooldown/IN_MILISECONDS);
|
||||
|
||||
@@ -2438,7 +2437,7 @@ bool Creature::HasSpellCooldown(uint32 spell_id) const
|
||||
bool Creature::HasSpell(uint32 spellID) const
|
||||
{
|
||||
uint8 i;
|
||||
for(i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
if(spellID == m_spells[i])
|
||||
break;
|
||||
return i < CREATURE_MAX_SPELLS; //broke before end of iteration of known spells
|
||||
@@ -2542,7 +2541,7 @@ uint32 Creature::GetVendorItemCurrentCount(VendorItem const* vItem)
|
||||
return vItem->maxcount;
|
||||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for(; itr != m_vendorItemCounts.end(); ++itr)
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if(itr->itemId==vItem->item)
|
||||
break;
|
||||
|
||||
@@ -2577,7 +2576,7 @@ uint32 Creature::UpdateVendorItemCurrentCount(VendorItem const* vItem, uint32 us
|
||||
return 0;
|
||||
|
||||
VendorItemCounts::iterator itr = m_vendorItemCounts.begin();
|
||||
for(; itr != m_vendorItemCounts.end(); ++itr)
|
||||
for (; itr != m_vendorItemCounts.end(); ++itr)
|
||||
if(itr->itemId==vItem->item)
|
||||
break;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature)
|
||||
if(PlList.isEmpty())
|
||||
return;
|
||||
|
||||
for(Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
for (Map::PlayerList::const_iterator i = PlList.begin(); i != PlList.end(); ++i)
|
||||
{
|
||||
if(Player* pPlayer = i->getSource())
|
||||
{
|
||||
@@ -94,7 +94,7 @@ void CreatureAI::DoZoneInCombat(Creature* creature)
|
||||
}
|
||||
|
||||
/* Causes certain things to never leave the threat list (Priest Lightwell, etc):
|
||||
for(Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
|
||||
for (Unit::ControlList::const_iterator itr = pPlayer->m_Controlled.begin(); itr != pPlayer->m_Controlled.end(); ++itr)
|
||||
{
|
||||
creature->SetInCombatWith(*itr);
|
||||
(*itr)->SetInCombatWith(creature);
|
||||
@@ -108,7 +108,7 @@ void CreatureAI::MoveInLineOfSight(Unit *who)
|
||||
{
|
||||
if(me->getVictim())
|
||||
return;
|
||||
|
||||
|
||||
if (me->GetTypeId() == CREATURE_TYPE_NON_COMBAT_PET) // non-combat pets should just stand there and look good;)
|
||||
return;
|
||||
|
||||
|
||||
@@ -140,7 +140,7 @@ class TRINITY_DLL_SPEC CreatureAI : public UnitAI
|
||||
|
||||
void DoZoneInCombat(Creature* pUnit = NULL);
|
||||
|
||||
// Called at text emote receive from player
|
||||
// Called at text emote receive from player
|
||||
virtual void ReceiveEmote(Player* pPlayer, uint32 text_emote) {}
|
||||
|
||||
///== Triggered Actions Requested ==================
|
||||
|
||||
@@ -413,7 +413,7 @@ class EventMap : private std::map<uint32, uint32>
|
||||
{
|
||||
time += m_time;
|
||||
gcd = (1 << (gcd + 16));
|
||||
for(iterator itr = begin(); itr != end();)
|
||||
for (iterator itr = begin(); itr != end(); )
|
||||
{
|
||||
if(itr->first >= time)
|
||||
break;
|
||||
@@ -429,7 +429,7 @@ class EventMap : private std::map<uint32, uint32>
|
||||
|
||||
void CancelEvent(uint32 eventId)
|
||||
{
|
||||
for(iterator itr = begin(); itr != end();)
|
||||
for (iterator itr = begin(); itr != end(); )
|
||||
{
|
||||
if(eventId == (itr->second & 0x0000FFFF))
|
||||
erase(itr++);
|
||||
@@ -440,7 +440,7 @@ class EventMap : private std::map<uint32, uint32>
|
||||
|
||||
void CancelEventsByGCD(uint32 gcd)
|
||||
{
|
||||
for(iterator itr = begin(); itr != end();)
|
||||
for (iterator itr = begin(); itr != end(); )
|
||||
{
|
||||
if(itr->second & gcd)
|
||||
erase(itr++);
|
||||
@@ -482,7 +482,6 @@ struct AISpellInfoType
|
||||
|
||||
TRINITY_DLL_SPEC AISpellInfoType * GetAISpellInfo(uint32 i);
|
||||
|
||||
|
||||
inline void CreatureAI::SetGazeOn(Unit *target)
|
||||
{
|
||||
if(me->canAttack(target))
|
||||
@@ -573,7 +572,7 @@ inline bool CreatureAI::_EnterEvadeMode()
|
||||
me->LoadCreaturesAddon();
|
||||
me->SetLootRecipient(NULL);
|
||||
me->ResetPlayerDamageReq();
|
||||
|
||||
|
||||
if(me->IsInEvadeMode())
|
||||
return false;
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace FactorySelector
|
||||
|
||||
if(!ai_factory)
|
||||
{
|
||||
for(uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
for (uint32 i = 0; i < CREATURE_MAX_SPELLS; ++i)
|
||||
{
|
||||
if(creature->m_spells[i])
|
||||
{
|
||||
@@ -93,7 +93,7 @@ namespace FactorySelector
|
||||
int best_val = -1;
|
||||
typedef CreatureAIRegistry::RegistryMapType RMT;
|
||||
RMT const &l = ai_registry.GetRegisteredItems();
|
||||
for( RMT::const_iterator iter = l.begin(); iter != l.end(); ++iter)
|
||||
for (RMT::const_iterator iter = l.begin(); iter != l.end(); ++iter)
|
||||
{
|
||||
const CreatureAICreator *factory = iter->second;
|
||||
const SelectableAI *p = dynamic_cast<const SelectableAI *>(factory);
|
||||
@@ -125,7 +125,7 @@ namespace FactorySelector
|
||||
int best_val = -1;
|
||||
std::vector<std::string> l;
|
||||
mv_registry.GetRegisteredItems(l);
|
||||
for( std::vector<std::string>::iterator iter = l.begin(); iter != l.end(); ++iter)
|
||||
for (std::vector<std::string>::iterator iter = l.begin(); iter != l.end(); ++iter)
|
||||
{
|
||||
const MovementGeneratorCreator *factory = mv_registry.GetRegistryItem((*iter).c_str());
|
||||
const SelectableMovement *p = dynamic_cast<const SelectableMovement *>(factory);
|
||||
|
||||
@@ -722,7 +722,7 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
|
||||
{
|
||||
//sLog.outErrorDb("CreatureEventAI: Creature Entry %u has EventAI script but it also has C++ script. EventAI script will be overriden.", cInfo->Entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (result->NextRow());
|
||||
|
||||
delete result;
|
||||
|
||||
@@ -142,7 +142,7 @@ void CreatureGroupManager::LoadCreatureFormations()
|
||||
}
|
||||
|
||||
CreatureGroupMap[memberGUID] = group_member;
|
||||
}
|
||||
}
|
||||
while(result->NextRow()) ;
|
||||
|
||||
sLog.outString();
|
||||
@@ -185,7 +185,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target)
|
||||
if(groupAI == 1 && member != m_leader)
|
||||
return;
|
||||
|
||||
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
sLog.outDebug("GROUP ATTACK: group instance id %u calls member instid %u", m_leader->GetInstanceId(), member->GetInstanceId());
|
||||
//sLog.outDebug("AI:%u:Group member found: %u, attacked by %s.", groupAI, itr->second->GetGUIDLow(), member->getVictim()->GetName());
|
||||
@@ -207,7 +207,7 @@ void CreatureGroup::MemberAttackStart(Creature *member, Unit *target)
|
||||
|
||||
void CreatureGroup::FormationReset(bool dismiss)
|
||||
{
|
||||
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
if(itr->first != m_leader && itr->first->isAlive())
|
||||
{
|
||||
@@ -228,14 +228,14 @@ void CreatureGroup::LeaderMoveTo(float x, float y, float z)
|
||||
|
||||
float pathangle = atan2(m_leader->GetPositionY() - y, m_leader->GetPositionX() - x);
|
||||
|
||||
for(CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
for (CreatureGroupMemberType::iterator itr = m_members.begin(); itr != m_members.end(); ++itr)
|
||||
{
|
||||
Creature *member = itr->first;
|
||||
if(member == m_leader || !member->isAlive() || member->getVictim())
|
||||
continue;
|
||||
|
||||
float angle = itr->second->follow_angle;
|
||||
float dist = itr->second->follow_dist;
|
||||
float dist = itr->second->follow_dist;
|
||||
|
||||
float dx = x + cos(angle + pathangle) * dist;
|
||||
float dy = y + sin(angle + pathangle) * dist;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*
|
||||
* Copyright (C) 2008-2009 Trinity <http://www.trinitycore.org/>
|
||||
@@ -28,8 +28,8 @@ class CreatureGroup;
|
||||
struct FormationInfo
|
||||
{
|
||||
uint32 leaderGUID;
|
||||
float follow_dist;
|
||||
float follow_angle;
|
||||
float follow_dist;
|
||||
float follow_angle;
|
||||
uint8 groupAI;
|
||||
};
|
||||
|
||||
@@ -59,7 +59,7 @@ class CreatureGroup
|
||||
//Group cannot be created empty
|
||||
explicit CreatureGroup(uint32 id) : m_groupID(id), m_leader(NULL), m_Formed(false) {}
|
||||
~CreatureGroup() { sLog.outDebug("Destroying group"); }
|
||||
|
||||
|
||||
Creature* getLeader() const { return m_leader; }
|
||||
uint32 GetId() const { return m_groupID; }
|
||||
bool isEmpty() const { return m_members.empty(); }
|
||||
|
||||
+19
-19
@@ -178,7 +178,7 @@ inline void LoadDBC(uint32& availableDbcLocales,barGoLink& bar, StoreProblemList
|
||||
if(storage.Load(dbc_filename.c_str(), sql))
|
||||
{
|
||||
bar.step();
|
||||
for(uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 0; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
if(!(availableDbcLocales & (1 << i)))
|
||||
continue;
|
||||
@@ -220,7 +220,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sAreaStore, dbcPath,"AreaTable.dbc");
|
||||
|
||||
// must be after sAreaStore loading
|
||||
for(uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
|
||||
for (uint32 i = 0; i < sAreaStore.GetNumRows(); ++i) // areaflag numbered from 0
|
||||
{
|
||||
if(AreaTableEntry const* area = sAreaStore.LookupEntry(i))
|
||||
{
|
||||
@@ -259,7 +259,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sEmotesStore, dbcPath,"Emotes.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sEmotesTextStore, dbcPath,"EmotesText.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionStore, dbcPath,"Faction.dbc");
|
||||
for (uint32 i=0;i<sFactionStore.GetNumRows(); ++i)
|
||||
for (uint32 i=0; i<sFactionStore.GetNumRows(); ++i)
|
||||
{
|
||||
FactionEntry const * faction = sFactionStore.LookupEntry(i);
|
||||
if (faction && faction->team)
|
||||
@@ -271,7 +271,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sFactionTemplateStore, dbcPath,"FactionTemplate.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sGameObjectDisplayInfoStore, dbcPath,"GameObjectDisplayInfo.dbc");
|
||||
for(uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 0; i < sGameObjectDisplayInfoStore.GetNumRows(); ++i)
|
||||
{
|
||||
if(GameObjectDisplayInfoEntry const * info = sGameObjectDisplayInfoStore.LookupEntry(i))
|
||||
{
|
||||
@@ -323,7 +323,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSkillLineAbilityStore, dbcPath,"SkillLineAbility.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSoundEntriesStore, dbcPath,"SoundEntries.dbc");
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sSpellStore, dbcPath,"Spell.dbc", &CustomSpellEntryfmt, &CustomSpellEntryIndex);
|
||||
for(uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const * spell = sSpellStore.LookupEntry(i);
|
||||
if(spell && spell->Category)
|
||||
@@ -388,7 +388,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
// prepare fast data access to bit pos of talent ranks for use at inspecting
|
||||
{
|
||||
// now have all max ranks (and then bit amount used for store talent ranks in inspect)
|
||||
for(uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
|
||||
for (uint32 talentTabId = 1; talentTabId < sTalentTabStore.GetNumRows(); ++talentTabId)
|
||||
{
|
||||
TalentTabEntry const *talentTabInfo = sTalentTabStore.LookupEntry( talentTabId );
|
||||
if(!talentTabInfo)
|
||||
@@ -400,7 +400,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
|
||||
// store class talent tab pages
|
||||
uint32 cls = 1;
|
||||
for(uint32 m=1;!(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES;m <<=1, ++cls) {}
|
||||
for (uint32 m=1; !(m & talentTabInfo->ClassMask) && cls < MAX_CLASSES; m <<=1, ++cls) {}
|
||||
|
||||
sTalentTabPages[cls][talentTabInfo->tabpage]=talentTabId;
|
||||
}
|
||||
@@ -409,7 +409,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiNodesStore, dbcPath,"TaxiNodes.dbc");
|
||||
|
||||
LoadDBC(availableDbcLocales,bar,bad_dbc_files,sTaxiPathStore, dbcPath,"TaxiPath.dbc");
|
||||
for(uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiPathStore.GetNumRows(); ++i)
|
||||
if(TaxiPathEntry const* entry = sTaxiPathStore.LookupEntry(i))
|
||||
sTaxiPathSetBySource[entry->from][entry->to] = TaxiPathBySourceAndDestination(entry->ID,entry->price);
|
||||
uint32 pathCount = sTaxiPathStore.GetNumRows();
|
||||
@@ -419,7 +419,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
// Calculate path nodes count
|
||||
std::vector<uint32> pathLength;
|
||||
pathLength.resize(pathCount); // 0 and some other indexes not used
|
||||
for(uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
|
||||
if(TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
|
||||
{
|
||||
if (pathLength[entry->path] < entry->index + 1)
|
||||
@@ -427,10 +427,10 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
}
|
||||
// Set path length
|
||||
sTaxiPathNodesByPath.resize(pathCount); // 0 and some other indexes not used
|
||||
for(uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiPathNodesByPath.size(); ++i)
|
||||
sTaxiPathNodesByPath[i].resize(pathLength[i]);
|
||||
// fill data
|
||||
for(uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiPathNodeStore.GetNumRows(); ++i)
|
||||
if(TaxiPathNodeEntry const* entry = sTaxiPathNodeStore.LookupEntry(i))
|
||||
sTaxiPathNodesByPath[entry->path][entry->index] = TaxiPathNode(entry->mapid,entry->x,entry->y,entry->z,entry->actionFlag,entry->delay);
|
||||
sTaxiPathNodeStore.Clear();
|
||||
@@ -439,15 +439,15 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
// include existed nodes that have at least single not spell base (scripted) path
|
||||
{
|
||||
std::set<uint32> spellPaths;
|
||||
for(uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows (); ++i)
|
||||
if(SpellEntry const* sInfo = sSpellStore.LookupEntry (i))
|
||||
for(int j=0; j < 3; ++j)
|
||||
for (int j=0; j < 3; ++j)
|
||||
if(sInfo->Effect[j]==123 /*SPELL_EFFECT_SEND_TAXI*/)
|
||||
spellPaths.insert(sInfo->EffectMiscValue[j]);
|
||||
|
||||
memset(sTaxiNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
memset(sOldContinentsNodesMask,0,sizeof(sTaxiNodesMask));
|
||||
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
|
||||
if(!node)
|
||||
@@ -457,7 +457,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
if(src_i!=sTaxiPathSetBySource.end() && !src_i->second.empty())
|
||||
{
|
||||
bool ok = false;
|
||||
for(TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin();dest_i != src_i->second.end(); ++dest_i)
|
||||
for (TaxiPathSetForSource::const_iterator dest_i = src_i->second.begin(); dest_i != src_i->second.end(); ++dest_i)
|
||||
{
|
||||
// not spell path
|
||||
if(spellPaths.find(dest_i->second.ID)==spellPaths.end())
|
||||
@@ -498,7 +498,7 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
else if(!bad_dbc_files.empty() )
|
||||
{
|
||||
std::string str;
|
||||
for(std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
|
||||
for (std::list<std::string>::iterator i = bad_dbc_files.begin(); i != bad_dbc_files.end(); ++i)
|
||||
str += *i + "\n";
|
||||
|
||||
sLog.outError("\nSome required *.dbc files (%u from %d) not found or not compatible:\n%s",(uint32)bad_dbc_files.size(),DBCFilesCount,str.c_str());
|
||||
@@ -524,14 +524,14 @@ void LoadDBCStores(const std::string& dataPath)
|
||||
|
||||
SimpleFactionsList const* GetFactionTeamList(uint32 faction, bool &isTeamMember)
|
||||
{
|
||||
for(FactionTeamMap::const_iterator itr = sFactionTeamMap.begin(); itr != sFactionTeamMap.end(); ++itr)
|
||||
for (FactionTeamMap::const_iterator itr = sFactionTeamMap.begin(); itr != sFactionTeamMap.end(); ++itr)
|
||||
{
|
||||
if(itr->first == faction)
|
||||
{
|
||||
isTeamMember = false;
|
||||
return &itr->second;
|
||||
}
|
||||
for(SimpleFactionsList::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
||||
for (SimpleFactionsList::const_iterator itr2 = itr->second.begin(); itr2 != itr->second.end(); ++itr2)
|
||||
{
|
||||
if((*itr2) == faction)
|
||||
{
|
||||
@@ -640,7 +640,7 @@ ContentLevels GetContentLevelsForMapAndZone(uint32 mapid, uint32 zoneId)
|
||||
ChatChannelsEntry const* GetChannelEntryFor(uint32 channel_id)
|
||||
{
|
||||
// not sorted, numbering index from 0
|
||||
for(uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 0; i < sChatChannelsStore.GetNumRows(); ++i)
|
||||
{
|
||||
ChatChannelsEntry const* ch = sChatChannelsStore.LookupEntry(i);
|
||||
if(ch && ch->ChannelID == channel_id)
|
||||
|
||||
@@ -390,7 +390,6 @@ struct AchievementCriteriaEntry
|
||||
uint32 goldInCopper; // 4
|
||||
} quest_reward_money;
|
||||
|
||||
|
||||
// ACHIEVEMENT_CRITERIA_TYPE_LOOT_MONEY = 67
|
||||
struct
|
||||
{
|
||||
@@ -837,10 +836,10 @@ struct FactionTemplateEntry
|
||||
return true;
|
||||
if(entry.faction)
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
return false;
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
return true;
|
||||
}
|
||||
@@ -852,10 +851,10 @@ struct FactionTemplateEntry
|
||||
return false;
|
||||
if(entry.faction)
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] == entry.faction)
|
||||
return true;
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (friendFaction[i] == entry.faction)
|
||||
return false;
|
||||
}
|
||||
@@ -864,7 +863,7 @@ struct FactionTemplateEntry
|
||||
bool IsHostileToPlayers() const { return (hostileMask & FACTION_MASK_PLAYER) !=0; }
|
||||
bool IsNeutralToAll() const
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
if (enemyFaction[i] != 0)
|
||||
return false;
|
||||
return hostileMask == 0 && friendlyMask == 0;
|
||||
|
||||
@@ -465,7 +465,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(const char* args)
|
||||
if (list_queue)
|
||||
{
|
||||
std::vector<Item *> &updateQueue = player->GetItemUpdateQueue();
|
||||
for(size_t i = 0; i < updateQueue.size(); ++i)
|
||||
for (size_t i = 0; i < updateQueue.size(); ++i)
|
||||
{
|
||||
Item *item = updateQueue[i];
|
||||
if(!item) continue;
|
||||
@@ -608,7 +608,7 @@ bool ChatHandler::HandleDebugGetItemStateCommand(const char* args)
|
||||
}
|
||||
}
|
||||
|
||||
for(size_t i = 0; i < updateQueue.size(); ++i)
|
||||
for (size_t i = 0; i < updateQueue.size(); ++i)
|
||||
{
|
||||
Item *item = updateQueue[i];
|
||||
if(!item) continue;
|
||||
@@ -669,7 +669,7 @@ bool ChatHandler::HandleDebugThreatList(const char * /*args*/)
|
||||
std::list<HostilReference*>::iterator itr;
|
||||
uint32 cnt = 0;
|
||||
PSendSysMessage("Threat list of %s (guid %u)",target->GetName(), target->GetGUIDLow());
|
||||
for(itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
for (itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
Unit* unit = (*itr)->getTarget();
|
||||
if(!unit)
|
||||
@@ -901,7 +901,7 @@ bool ChatHandler::HandleDebugSetAuraStateCommand(const char* args)
|
||||
if (!state)
|
||||
{
|
||||
// reset all states
|
||||
for(int i = 1; i <= 32; ++i)
|
||||
for (int i = 1; i <= 32; ++i)
|
||||
unit->ModifyAuraState(AuraState(i),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -135,12 +135,12 @@ void DynamicObject::Update(uint32 p_time)
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
||||
MaNGOS::DynamicObjectUpdater notifier(*this, caster);
|
||||
|
||||
|
||||
TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, WorldTypeMapContainer > world_object_notifier(notifier);
|
||||
TypeContainerVisitor<MaNGOS::DynamicObjectUpdater, GridTypeMapContainer > grid_object_notifier(notifier);
|
||||
|
||||
|
||||
CellLock<GridReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, world_object_notifier, *GetMap(), *this, m_radius);
|
||||
cell_lock->Visit(cell_lock, grid_object_notifier, *GetMap(), *this, m_radius);
|
||||
|
||||
@@ -80,7 +80,7 @@ FleeingMovementGenerator<T>::_getPoint(T &owner, float &x, float &y, float &z)
|
||||
float temp_x, temp_y, angle;
|
||||
const Map * _map = owner.GetBaseMap();
|
||||
//primitive path-finding
|
||||
for(uint8 i = 0; i < 18; ++i)
|
||||
for (uint8 i = 0; i < 18; ++i)
|
||||
{
|
||||
if(i_only_forward && i > 2)
|
||||
break;
|
||||
|
||||
+27
-28
@@ -58,7 +58,7 @@ bool GameEventMgr::CheckOneGameEvent(uint16 entry) const
|
||||
case GAMEEVENT_WORLD_INACTIVE:
|
||||
{
|
||||
time_t currenttime = time(NULL);
|
||||
for(std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
||||
for (std::set<uint16>::const_iterator itr = mGameEvent[entry].prerequisite_events.begin(); itr != mGameEvent[entry].prerequisite_events.end(); ++itr)
|
||||
{
|
||||
if( (mGameEvent[*itr].state != GAMEEVENT_WORLD_NEXTPHASE && mGameEvent[*itr].state != GAMEEVENT_WORLD_FINISHED) || // if prereq not in nextphase or finished state, then can't start this one
|
||||
mGameEvent[*itr].nextstart > currenttime) // if not in nextphase state for long enough, can't start this one
|
||||
@@ -181,7 +181,7 @@ void GameEventMgr::StopEvent( uint16 event_id, bool overwrite )
|
||||
mGameEvent[event_id].nextstart = 0;
|
||||
mGameEvent[event_id].state = GAMEEVENT_WORLD_INACTIVE;
|
||||
std::map<uint32 /*condition id*/, GameEventFinishCondition>::iterator itr;
|
||||
for(itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
|
||||
for (itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
|
||||
itr->second.done = 0;
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("DELETE FROM game_event_save WHERE event_id = '%u'",event_id);
|
||||
@@ -351,7 +351,6 @@ void GameEventMgr::LoadFromDB()
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if(mGameEvent[event_id].state != GAMEEVENT_NORMAL && mGameEvent[event_id].state != GAMEEVENT_INTERNAL)
|
||||
{
|
||||
uint16 prerequisite_event = fields[1].GetUInt16();
|
||||
@@ -839,7 +838,7 @@ void GameEventMgr::LoadFromDB()
|
||||
// get the event npc flag for checking if the npc will be vendor during the event or not
|
||||
uint32 event_npc_flag = 0;
|
||||
NPCFlagList& flist = mGameEventNPCFlags[event_id];
|
||||
for(NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr)
|
||||
for (NPCFlagList::const_iterator itr = flist.begin(); itr != flist.end(); ++itr)
|
||||
{
|
||||
if(itr->first == guid)
|
||||
{
|
||||
@@ -1014,7 +1013,7 @@ uint32 GameEventMgr::GetNPCFlag(Creature * cr)
|
||||
uint32 mask = 0;
|
||||
uint32 guid = cr->GetDBTableGUIDLow();
|
||||
|
||||
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
for (ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
{
|
||||
for(NPCFlagList::iterator itr = mGameEventNPCFlags[*e_itr].begin();
|
||||
itr != mGameEventNPCFlags[*e_itr].end();
|
||||
@@ -1102,13 +1101,13 @@ uint32 GameEventMgr::Update() // return the next e
|
||||
// now activate the queue
|
||||
// a now activated event can contain a spawn of a to-be-deactivated one
|
||||
// following the activate - deactivate order, deactivating the first event later will leave the spawn in (wont disappear then reappear clientside)
|
||||
for(std::set<uint16>::iterator itr = activate.begin(); itr != activate.end(); ++itr)
|
||||
for (std::set<uint16>::iterator itr = activate.begin(); itr != activate.end(); ++itr)
|
||||
// start the event
|
||||
// returns true the started event completed
|
||||
// in that case, initiate next update in 1 second
|
||||
if(StartEvent(*itr))
|
||||
nextEventDelay = 0;
|
||||
for(std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
|
||||
for (std::set<uint16>::iterator itr = deactivate.begin(); itr != deactivate.end(); ++itr)
|
||||
StopEvent(*itr);
|
||||
sLog.outDetail("Next game event check in %u seconds.", nextEventDelay + 1);
|
||||
return (nextEventDelay + 1) * IN_MILISECONDS; // Add 1 second to be sure event has started/stopped at next call
|
||||
@@ -1167,7 +1166,7 @@ void GameEventMgr::ApplyNewEvent(uint16 event_id)
|
||||
void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
|
||||
{
|
||||
// go through the creatures whose npcflags are changed in the event
|
||||
for(NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr)
|
||||
for (NPCFlagList::iterator itr = mGameEventNPCFlags[event_id].begin(); itr != mGameEventNPCFlags[event_id].end(); ++itr)
|
||||
{
|
||||
// get the creature data from the low guid to get the entry, to be able to find out the whole guid
|
||||
if( CreatureData const* data = objmgr.GetCreatureData(itr->first) )
|
||||
@@ -1193,14 +1192,14 @@ void GameEventMgr::UpdateEventNPCFlags(uint16 event_id)
|
||||
void GameEventMgr::UpdateBattleGroundSettings()
|
||||
{
|
||||
uint32 mask = 0;
|
||||
for(ActiveEvents::const_iterator itr = m_ActiveEvents.begin(); itr != m_ActiveEvents.end(); ++itr )
|
||||
for (ActiveEvents::const_iterator itr = m_ActiveEvents.begin(); itr != m_ActiveEvents.end(); ++itr )
|
||||
mask |= mGameEventBattleGroundHolidays[*itr];
|
||||
sBattleGroundMgr.SetHolidayWeekends(mask);
|
||||
}
|
||||
|
||||
void GameEventMgr::UpdateEventNPCVendor(uint16 event_id, bool activate)
|
||||
{
|
||||
for(NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr)
|
||||
for (NPCVendorList::iterator itr = mGameEventVendors[event_id].begin(); itr != mGameEventVendors[event_id].end(); ++itr)
|
||||
{
|
||||
if(activate)
|
||||
objmgr.AddVendorItem(itr->entry, itr->item, itr->maxcount, itr->incrtime, itr->ExtendedCost, false);
|
||||
@@ -1219,7 +1218,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
|
||||
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// Add to correct cell
|
||||
CreatureData const* data = objmgr.GetCreatureData(*itr);
|
||||
@@ -1252,7 +1251,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
|
||||
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// Add to correct cell
|
||||
GameObjectData const* data = objmgr.GetGOData(*itr);
|
||||
@@ -1286,7 +1285,7 @@ void GameEventMgr::GameEventSpawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr)
|
||||
{
|
||||
poolhandler.SpawnPool(*itr);
|
||||
}
|
||||
@@ -1302,7 +1301,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin();itr != mGameEventCreatureGuids[internal_event_id].end();++itr)
|
||||
for (GuidList::iterator itr = mGameEventCreatureGuids[internal_event_id].begin(); itr != mGameEventCreatureGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// check if it's needed by another event, if so, don't remove
|
||||
if( event_id > 0 && hasCreatureActiveEventExcept(*itr,event_id) )
|
||||
@@ -1323,7 +1322,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin();itr != mGameEventGameobjectGuids[internal_event_id].end();++itr)
|
||||
for (GuidList::iterator itr = mGameEventGameobjectGuids[internal_event_id].begin(); itr != mGameEventGameobjectGuids[internal_event_id].end(); ++itr)
|
||||
{
|
||||
// check if it's needed by another event, if so, don't remove
|
||||
if( event_id >0 && hasGameObjectActiveEventExcept(*itr,event_id) )
|
||||
@@ -1343,7 +1342,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
return;
|
||||
}
|
||||
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin();itr != mGameEventPoolIds[internal_event_id].end();++itr)
|
||||
for (IdList::iterator itr = mGameEventPoolIds[internal_event_id].begin(); itr != mGameEventPoolIds[internal_event_id].end(); ++itr)
|
||||
{
|
||||
poolhandler.DespawnPool(*itr);
|
||||
}
|
||||
@@ -1351,7 +1350,7 @@ void GameEventMgr::GameEventUnspawn(int16 event_id)
|
||||
|
||||
void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
{
|
||||
for(ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin();itr != mGameEventModelEquip[event_id].end();++itr)
|
||||
for (ModelEquipList::iterator itr = mGameEventModelEquip[event_id].begin(); itr != mGameEventModelEquip[event_id].end(); ++itr)
|
||||
{
|
||||
// Remove the creature from grid
|
||||
CreatureData const* data = objmgr.GetCreatureData(itr->first);
|
||||
@@ -1431,7 +1430,7 @@ void GameEventMgr::ChangeEquipOrModel(int16 event_id, bool activate)
|
||||
|
||||
bool GameEventMgr::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
|
||||
{
|
||||
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
for (ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
{
|
||||
if((*e_itr) != event_id)
|
||||
for(QuestRelList::iterator itr = mGameEventCreatureQuests[*e_itr].begin();
|
||||
@@ -1445,7 +1444,7 @@ bool GameEventMgr::hasCreatureQuestActiveEventExcept(uint32 quest_id, uint16 eve
|
||||
|
||||
bool GameEventMgr::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 event_id)
|
||||
{
|
||||
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
for (ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
{
|
||||
if((*e_itr) != event_id)
|
||||
for(QuestRelList::iterator itr = mGameEventGameObjectQuests[*e_itr].begin();
|
||||
@@ -1458,7 +1457,7 @@ bool GameEventMgr::hasGameObjectQuestActiveEventExcept(uint32 quest_id, uint16 e
|
||||
}
|
||||
bool GameEventMgr::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event_id)
|
||||
{
|
||||
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
for (ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
{
|
||||
if((*e_itr) != event_id)
|
||||
{
|
||||
@@ -1474,7 +1473,7 @@ bool GameEventMgr::hasCreatureActiveEventExcept(uint32 creature_id, uint16 event
|
||||
}
|
||||
bool GameEventMgr::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
|
||||
{
|
||||
for(ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
for (ActiveEvents::iterator e_itr = m_ActiveEvents.begin(); e_itr != m_ActiveEvents.end(); ++e_itr)
|
||||
{
|
||||
if((*e_itr) != event_id)
|
||||
{
|
||||
@@ -1492,7 +1491,7 @@ bool GameEventMgr::hasGameObjectActiveEventExcept(uint32 go_id, uint16 event_id)
|
||||
void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
{
|
||||
QuestRelList::iterator itr;
|
||||
for (itr = mGameEventCreatureQuests[event_id].begin();itr != mGameEventCreatureQuests[event_id].end();++itr)
|
||||
for (itr = mGameEventCreatureQuests[event_id].begin(); itr != mGameEventCreatureQuests[event_id].end(); ++itr)
|
||||
{
|
||||
QuestRelations &CreatureQuestMap = objmgr.mCreatureQuestRelations;
|
||||
if (Activate) // Add the pair(id,quest) to the multimap
|
||||
@@ -1506,7 +1505,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
if (qitr == CreatureQuestMap.end())
|
||||
continue;
|
||||
QuestRelations::iterator lastElement = CreatureQuestMap.upper_bound(itr->first);
|
||||
for ( ;qitr != lastElement;++qitr)
|
||||
for (; qitr != lastElement; ++qitr)
|
||||
{
|
||||
if (qitr->second == itr->second)
|
||||
{
|
||||
@@ -1517,7 +1516,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
}
|
||||
}
|
||||
}
|
||||
for (itr = mGameEventGameObjectQuests[event_id].begin();itr != mGameEventGameObjectQuests[event_id].end();++itr)
|
||||
for (itr = mGameEventGameObjectQuests[event_id].begin(); itr != mGameEventGameObjectQuests[event_id].end(); ++itr)
|
||||
{
|
||||
QuestRelations &GameObjectQuestMap = objmgr.mGOQuestRelations;
|
||||
if (Activate) // Add the pair(id,quest) to the multimap
|
||||
@@ -1531,7 +1530,7 @@ void GameEventMgr::UpdateEventQuests(uint16 event_id, bool Activate)
|
||||
if (qitr == GameObjectQuestMap.end())
|
||||
continue;
|
||||
QuestRelations::iterator lastElement = GameObjectQuestMap.upper_bound(itr->first);
|
||||
for ( ;qitr != lastElement;++qitr)
|
||||
for (; qitr != lastElement; ++qitr)
|
||||
{
|
||||
if (qitr->second == itr->second)
|
||||
{
|
||||
@@ -1596,7 +1595,7 @@ void GameEventMgr::HandleQuestComplete(uint32 quest_id)
|
||||
|
||||
bool GameEventMgr::CheckOneGameEventConditions(uint16 event_id)
|
||||
{
|
||||
for(std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
|
||||
for (std::map<uint32,GameEventFinishCondition>::iterator itr = mGameEvent[event_id].conditions.begin(); itr != mGameEvent[event_id].conditions.end(); ++itr)
|
||||
if(itr->second.done < itr->second.reqNum)
|
||||
// return false if a condition doesn't match
|
||||
return false;
|
||||
@@ -1637,7 +1636,7 @@ void GameEventMgr::HandleWorldEventGossip(Player *plr, Creature *c)
|
||||
void GameEventMgr::SendWorldStateUpdate(Player * plr, uint16 event_id)
|
||||
{
|
||||
std::map<uint32,GameEventFinishCondition>::iterator itr;
|
||||
for(itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr)
|
||||
for (itr = mGameEvent[event_id].conditions.begin(); itr !=mGameEvent[event_id].conditions.end(); ++itr)
|
||||
{
|
||||
if(itr->second.done_world_state)
|
||||
plr->SendUpdateWorldState(itr->second.done_world_state, (uint32)(itr->second.done));
|
||||
@@ -1651,7 +1650,7 @@ TRINITY_DLL_SPEC bool IsHolidayActive( HolidayIds id )
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& ae = gameeventmgr.GetActiveEventList();
|
||||
|
||||
for(GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
|
||||
for (GameEventMgr::ActiveEvents::const_iterator itr = ae.begin(); itr != ae.end(); ++itr)
|
||||
if(events[*itr].holiday_id==id)
|
||||
return true;
|
||||
|
||||
|
||||
@@ -633,7 +633,7 @@ bool GameObject::LoadFromDB(uint32 guid, Map *map)
|
||||
if(data->spawntimesecs >= 0)
|
||||
{
|
||||
m_spawnedByDefault = true;
|
||||
|
||||
|
||||
if(!GetGOInfo()->GetDespawnPossibility() && !GetGOInfo()->IsDespawnAtAction())
|
||||
{
|
||||
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NODESPAWN);
|
||||
@@ -684,7 +684,7 @@ GameObject* GameObject::GetGameObject(WorldObject& object, uint64 guid)
|
||||
bool GameObject::hasQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
return true;
|
||||
@@ -695,7 +695,7 @@ bool GameObject::hasQuest(uint32 quest_id) const
|
||||
bool GameObject::hasInvolvedQuest(uint32 quest_id) const
|
||||
{
|
||||
QuestRelations const& qr = objmgr.mGOQuestInvolvedRelations;
|
||||
for(QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
for (QuestRelations::const_iterator itr = qr.lower_bound(GetEntry()); itr != qr.upper_bound(GetEntry()); ++itr)
|
||||
{
|
||||
if(itr->second==quest_id)
|
||||
return true;
|
||||
@@ -1000,7 +1000,7 @@ void GameObject::Use(Unit* user)
|
||||
// every slot will be on that straight line
|
||||
float orthogonalOrientation = GetOrientation()+M_PI*0.5f;
|
||||
// find nearest slot
|
||||
for(uint32 i=0; i<info->chair.slots; ++i)
|
||||
for (uint32 i=0; i<info->chair.slots; ++i)
|
||||
{
|
||||
// the distance between this slot and the center of the go - imagine a 1D space
|
||||
float relativeDistance = (info->size*i)-(info->size*(info->chair.slots-1)/2.0f);
|
||||
@@ -1387,7 +1387,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
|
||||
return;
|
||||
|
||||
bool self = false;
|
||||
for(uint8 i = 0; i < 3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
if(spellInfo->EffectImplicitTargetA[i] == TARGET_UNIT_CASTER)
|
||||
{
|
||||
@@ -1416,7 +1416,7 @@ void GameObject::CastSpell(Unit* target, uint32 spellId)
|
||||
else
|
||||
{
|
||||
trigger->setFaction(14);
|
||||
// Set owner guid for target if no owner avalible - needed by trigger auras
|
||||
// Set owner guid for target if no owner avalible - needed by trigger auras
|
||||
// - trigger gets despawned and there's no caster avalible (see AuraEffect::TriggerSpell())
|
||||
trigger->CastSpell(target, spellInfo, true, 0, 0, target ? target->GetGUID() : 0);
|
||||
}
|
||||
|
||||
@@ -698,7 +698,6 @@ class TRINITY_DLL_SPEC GameObject : public WorldObject
|
||||
// 0 = use `gameobject`.`spawntimesecs`
|
||||
void ResetDoorOrButton();
|
||||
|
||||
|
||||
void TriggeringLinkedGameObject( uint32 trapEntry, Unit* target);
|
||||
|
||||
bool isVisibleForInState(Player const* u, bool inVisibleList) const;
|
||||
|
||||
@@ -238,7 +238,7 @@ void PlayerMenu::SendTalking( uint32 textID )
|
||||
|
||||
if (!pGossip)
|
||||
{
|
||||
for(uint32 i = 0; i < 8; ++i)
|
||||
for (uint32 i = 0; i < 8; ++i)
|
||||
{
|
||||
data << float(0);
|
||||
data << "Greetings $N";
|
||||
@@ -255,7 +255,7 @@ void PlayerMenu::SendTalking( uint32 textID )
|
||||
else
|
||||
{
|
||||
std::string Text_0[8],Text_1[8];
|
||||
for (int i=0;i<8;++i)
|
||||
for (int i=0; i<8; ++i)
|
||||
{
|
||||
Text_0[i]=pGossip->Options[i].Text_0;
|
||||
Text_1[i]=pGossip->Options[i].Text_1;
|
||||
@@ -266,7 +266,7 @@ void PlayerMenu::SendTalking( uint32 textID )
|
||||
NpcTextLocale const *nl = objmgr.GetNpcTextLocale(textID);
|
||||
if (nl)
|
||||
{
|
||||
for (int i=0;i<8;++i)
|
||||
for (int i=0; i<8; ++i)
|
||||
{
|
||||
if (nl->Text_0[i].size() > loc_idx && !nl->Text_0[i][loc_idx].empty())
|
||||
Text_0[i]=nl->Text_0[i][loc_idx];
|
||||
@@ -291,7 +291,7 @@ void PlayerMenu::SendTalking( uint32 textID )
|
||||
|
||||
data << pGossip->Options[i].Language;
|
||||
|
||||
for(int j = 0; j < 3; ++j)
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
data << pGossip->Options[i].Emotes[j]._Delay;
|
||||
data << pGossip->Options[i].Emotes[j]._Emote;
|
||||
@@ -307,7 +307,7 @@ void PlayerMenu::SendTalking( char const * title, char const * text )
|
||||
{
|
||||
WorldPacket data( SMSG_NPC_TEXT_UPDATE, 50 ); // guess size
|
||||
data << uint32(0);
|
||||
for(uint32 i = 0; i < 8; ++i)
|
||||
for (uint32 i = 0; i < 8; ++i)
|
||||
{
|
||||
data << float(0);
|
||||
data << title;
|
||||
@@ -521,7 +521,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
||||
Details = pQuest->GetDetails();
|
||||
Objectives = pQuest->GetObjectives();
|
||||
EndText = pQuest->GetEndText();
|
||||
for (int i=0;i<QUEST_OBJECTIVES_COUNT;++i)
|
||||
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
|
||||
ObjectiveText[i]=pQuest->ObjectiveText[i];
|
||||
|
||||
int loc_idx = pSession->GetSessionDbLocaleIndex();
|
||||
@@ -539,7 +539,7 @@ void PlayerMenu::SendQuestQueryResponse( Quest const *pQuest )
|
||||
if (ql->EndText.size() > loc_idx && !ql->EndText[loc_idx].empty())
|
||||
EndText=ql->EndText[loc_idx];
|
||||
|
||||
for (int i=0;i<QUEST_OBJECTIVES_COUNT;++i)
|
||||
for (int i=0; i<QUEST_OBJECTIVES_COUNT; ++i)
|
||||
if (ql->ObjectiveText[i].size() > loc_idx && !ql->ObjectiveText[i][loc_idx].empty())
|
||||
ObjectiveText[i]=ql->ObjectiveText[i][loc_idx];
|
||||
}
|
||||
|
||||
+10
-10
@@ -32,7 +32,7 @@ using namespace Trinity;
|
||||
void
|
||||
VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource() == &i_object)
|
||||
continue;
|
||||
@@ -50,7 +50,7 @@ VisibleChangesNotifier::Visit(PlayerMapType &m)
|
||||
void
|
||||
VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if(!iter->getSource()->GetSharedVisionList().empty())
|
||||
for(SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
@@ -61,7 +61,7 @@ VisibleChangesNotifier::Visit(CreatureMapType &m)
|
||||
void
|
||||
VisibleChangesNotifier::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
if(IS_PLAYER_GUID(iter->getSource()->GetCasterGUID()))
|
||||
if(Player* caster = (Player*)iter->getSource()->GetCaster())
|
||||
if(caster->m_seer == iter->getSource())
|
||||
@@ -75,7 +75,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
// but exist one case when this possible and object not out of range: transports
|
||||
if(Transport* transport = i_player.GetTransport())
|
||||
{
|
||||
for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr)
|
||||
for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr!=transport->GetPassengers().end(); ++itr)
|
||||
{
|
||||
if(i_clientGUIDs.find((*itr)->GetGUID())!=i_clientGUIDs.end())
|
||||
{
|
||||
@@ -88,7 +88,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
|
||||
// generate outOfRange for not iterate objects
|
||||
i_data.AddOutOfRangeGUID(i_clientGUIDs);
|
||||
for(Player::ClientGUIDs::iterator itr = i_clientGUIDs.begin();itr!=i_clientGUIDs.end();++itr)
|
||||
for (Player::ClientGUIDs::iterator itr = i_clientGUIDs.begin(); itr!=i_clientGUIDs.end(); ++itr)
|
||||
{
|
||||
i_player.m_clientGUIDs.erase(*itr);
|
||||
|
||||
@@ -118,7 +118,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
|
||||
// send out of range to other players if need
|
||||
std::set<uint64> const& oor = i_data.GetOutOfRangeGUIDs();
|
||||
for(std::set<uint64>::const_iterator iter = oor.begin(); iter != oor.end(); ++iter)
|
||||
for (std::set<uint64>::const_iterator iter = oor.begin(); iter != oor.end(); ++iter)
|
||||
{
|
||||
if(!IS_PLAYER_GUID(*iter))
|
||||
continue;
|
||||
@@ -132,7 +132,7 @@ PlayerVisibilityNotifier::Notify()
|
||||
// Now do operations that required done at object visibility change to visible
|
||||
|
||||
// send data at target visibility change (adding to client)
|
||||
for(std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
|
||||
for (std::set<WorldObject*>::const_iterator vItr = i_visibleNow.begin(); vItr != i_visibleNow.end(); ++vItr)
|
||||
// target aura duration for caster show only if target exist at caster client
|
||||
if((*vItr)!=&i_player && (*vItr)->isType(TYPEMASK_UNIT))
|
||||
i_player.SendInitialVisiblePackets((Unit*)(*vItr));
|
||||
@@ -157,7 +157,7 @@ MessageDistDeliverer::Visit(PlayerMapType &m)
|
||||
if (!target->GetSharedVisionList().empty())
|
||||
{
|
||||
SharedVisionList::const_iterator i = target->GetSharedVisionList().begin();
|
||||
for ( ; i != target->GetSharedVisionList().end(); ++i)
|
||||
for (; i != target->GetSharedVisionList().end(); ++i)
|
||||
if((*i)->m_seer == target)
|
||||
SendPacket(*i);
|
||||
}
|
||||
@@ -182,7 +182,7 @@ MessageDistDeliverer::Visit(CreatureMapType &m)
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
{
|
||||
SharedVisionList::const_iterator i = iter->getSource()->GetSharedVisionList().begin();
|
||||
for ( ; i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
for (; i != iter->getSource()->GetSharedVisionList().end(); ++i)
|
||||
if((*i)->m_seer == iter->getSource())
|
||||
SendPacket(*i);
|
||||
}
|
||||
@@ -224,7 +224,7 @@ MessageDistDeliverer::VisitObject(Player* plr)
|
||||
template<class T> void
|
||||
ObjectUpdater::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->IsInWorld())
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
|
||||
+12
-12
@@ -92,7 +92,7 @@ namespace Trinity
|
||||
|
||||
template<class T> void updateObjects(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
}
|
||||
|
||||
@@ -241,34 +241,34 @@ namespace Trinity
|
||||
|
||||
void Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
void Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(CorpseMapType &m)
|
||||
{
|
||||
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
|
||||
void Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
@@ -436,7 +436,7 @@ namespace Trinity
|
||||
|
||||
void Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
@@ -487,7 +487,7 @@ namespace Trinity
|
||||
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
@@ -507,7 +507,7 @@ namespace Trinity
|
||||
|
||||
void Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if (itr->getSource()->InSamePhase(i_searcher) && itr->getSource()->IsWithinDist(i_searcher,i_dist))
|
||||
i_do(itr->getSource());
|
||||
}
|
||||
@@ -1202,7 +1202,7 @@ namespace Trinity
|
||||
|
||||
~LocalizedPacketDo()
|
||||
{
|
||||
for(size_t i = 0; i < i_data_cache.size(); ++i)
|
||||
for (size_t i = 0; i < i_data_cache.size(); ++i)
|
||||
delete i_data_cache[i];
|
||||
}
|
||||
void operator()( Player* p );
|
||||
@@ -1222,8 +1222,8 @@ namespace Trinity
|
||||
|
||||
~LocalizedPacketListDo()
|
||||
{
|
||||
for(size_t i = 0; i < i_data_cache.size(); ++i)
|
||||
for(size_t j = 0; j < i_data_cache[i].size(); ++j)
|
||||
for (size_t i = 0; i < i_data_cache.size(); ++i)
|
||||
for (size_t j = 0; j < i_data_cache[i].size(); ++j)
|
||||
delete i_data_cache[i][j];
|
||||
}
|
||||
void operator()( Player* p );
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
inline void
|
||||
Trinity::ObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
if(iter->getSource()->IsInWorld() && !iter->getSource()->isSpiritService())
|
||||
iter->getSource()->Update(i_timeDiff);
|
||||
}
|
||||
@@ -63,7 +63,7 @@ template<class T>
|
||||
inline void
|
||||
Trinity::PlayerVisibilityNotifier::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_player.UpdateVisibilityOf(iter->getSource(),i_data,i_visibleNow);
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
@@ -74,7 +74,7 @@ template<>
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
|
||||
@@ -99,7 +99,7 @@ template<>
|
||||
inline void
|
||||
Trinity::PlayerRelocationNotifier::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
i_clientGUIDs.erase(iter->getSource()->GetGUID());
|
||||
|
||||
@@ -116,7 +116,7 @@ template<>
|
||||
inline void
|
||||
Trinity::CreatureRelocationNotifier::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
@@ -134,7 +134,7 @@ Trinity::CreatureRelocationNotifier::Visit(CreatureMapType &m)
|
||||
if(!i_creature.isAlive())
|
||||
return;
|
||||
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if(iter->getSource()->m_Notified)
|
||||
continue;
|
||||
@@ -175,9 +175,8 @@ inline void Trinity::DynamicObjectUpdater::VisitHelper(Unit* target)
|
||||
if(target->HasAura(i_dynobject.GetSpellId(), i_check->GetGUID()))
|
||||
return;
|
||||
|
||||
|
||||
uint32 eff_index = 0;
|
||||
for(; eff_index < MAX_SPELL_EFFECTS; ++eff_index)
|
||||
for (; eff_index < MAX_SPELL_EFFECTS; ++eff_index)
|
||||
if(i_dynobject.HasEffect(eff_index))
|
||||
break;
|
||||
|
||||
@@ -221,7 +220,7 @@ template<>
|
||||
inline void
|
||||
Trinity::DynamicObjectUpdater::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
VisitHelper(itr->getSource());
|
||||
}
|
||||
|
||||
@@ -229,7 +228,7 @@ template<>
|
||||
inline void
|
||||
Trinity::DynamicObjectUpdater::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
VisitHelper(itr->getSource());
|
||||
}
|
||||
|
||||
@@ -244,7 +243,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -264,7 +263,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(PlayerMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -284,7 +283,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CreatureMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -304,7 +303,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(CorpseMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -324,7 +323,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -340,7 +339,7 @@ void Trinity::WorldObjectSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -349,7 +348,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -358,7 +357,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
|
||||
{
|
||||
for(CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CorpseMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -367,7 +366,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(CorpseMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -376,7 +375,7 @@ void Trinity::WorldObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::WorldObjectListSearcher<Check>::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (DynamicObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -391,7 +390,7 @@ void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -407,7 +406,7 @@ void Trinity::GameObjectSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -420,7 +419,7 @@ void Trinity::GameObjectLastSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::GameObjectListSearcher<Check>::Visit(GameObjectMapType &m)
|
||||
{
|
||||
for(GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (GameObjectMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -435,7 +434,7 @@ void Trinity::UnitSearcher<Check>::Visit(CreatureMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -455,7 +454,7 @@ void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -471,7 +470,7 @@ void Trinity::UnitSearcher<Check>::Visit(PlayerMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -484,7 +483,7 @@ void Trinity::UnitLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -497,7 +496,7 @@ void Trinity::UnitLastSearcher<Check>::Visit(PlayerMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -506,7 +505,7 @@ void Trinity::UnitListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::UnitListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if(i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -521,7 +520,7 @@ void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -537,7 +536,7 @@ void Trinity::CreatureSearcher<Check>::Visit(CreatureMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -550,7 +549,7 @@ void Trinity::CreatureLastSearcher<Check>::Visit(CreatureMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (CreatureMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if( i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -559,7 +558,7 @@ void Trinity::CreatureListSearcher<Check>::Visit(CreatureMapType &m)
|
||||
template<class Check>
|
||||
void Trinity::PlayerListSearcher<Check>::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
if(itr->getSource()->InSamePhase(i_phaseMask))
|
||||
if( i_check(itr->getSource()))
|
||||
i_objects.push_back(itr->getSource());
|
||||
@@ -572,7 +571,7 @@ void Trinity::PlayerSearcher<Check>::Visit(PlayerMapType &m)
|
||||
if(i_object)
|
||||
return;
|
||||
|
||||
for(PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
for (PlayerMapType::iterator itr=m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if(!itr->getSource()->InSamePhase(i_phaseMask))
|
||||
continue;
|
||||
@@ -630,7 +629,7 @@ void MaNGOS::LocalizedPacketListDo<Builder>::operator()( Player* p )
|
||||
else
|
||||
data_list = &i_data_cache[cache_idx];
|
||||
|
||||
for(size_t i = 0; i < data_list->size(); ++i)
|
||||
for (size_t i = 0; i < data_list->size(); ++i)
|
||||
p->SendDirectMessage((*data_list)[i]);
|
||||
}
|
||||
|
||||
|
||||
+37
-37
@@ -71,8 +71,8 @@ Group::~Group()
|
||||
// it is undefined whether objectmgr (which stores the groups) or instancesavemgr
|
||||
// will be unloaded first so we must be prepared for both cases
|
||||
// this may unload some instance saves
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for(BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2)
|
||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (BoundInstancesMap::iterator itr2 = m_boundInstances[i].begin(); itr2 != m_boundInstances[i].end(); ++itr2)
|
||||
itr2->second.save->RemoveGroup(this);
|
||||
|
||||
// Sub group counters clean up
|
||||
@@ -156,7 +156,7 @@ bool Group::LoadGroupFromDB(const uint64 &leaderGuid, QueryResult *result, bool
|
||||
m_looterGuid = MAKE_NEW_GUID((*result)[3].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
m_lootThreshold = (ItemQualities)(*result)[4].GetUInt16();
|
||||
|
||||
for(int i=0; i<TARGETICONCOUNT; ++i)
|
||||
for (int i=0; i<TARGETICONCOUNT; ++i)
|
||||
m_targetIcons[i] = (*result)[5+i].GetUInt64();
|
||||
if(!external) delete result;
|
||||
|
||||
@@ -208,7 +208,7 @@ void Group::ConvertToRaid()
|
||||
SendUpdate();
|
||||
|
||||
// update quest related GO states (quest activity dependent from raid membership)
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
if(Player* player = objmgr.GetPlayer(citr->guid))
|
||||
player->UpdateForQuestWorldObjects();
|
||||
}
|
||||
@@ -252,7 +252,7 @@ uint32 Group::RemoveInvite(Player *player)
|
||||
|
||||
void Group::RemoveAllInvites()
|
||||
{
|
||||
for(InvitesList::iterator itr=m_invitees.begin(); itr!=m_invitees.end(); ++itr)
|
||||
for (InvitesList::iterator itr=m_invitees.begin(); itr!=m_invitees.end(); ++itr)
|
||||
(*itr)->SetGroupInvite(NULL);
|
||||
|
||||
m_invitees.clear();
|
||||
@@ -260,7 +260,7 @@ void Group::RemoveAllInvites()
|
||||
|
||||
Player* Group::GetInvited(const uint64& guid) const
|
||||
{
|
||||
for(InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
for (InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
{
|
||||
if((*itr)->GetGUID() == guid)
|
||||
return (*itr);
|
||||
@@ -270,7 +270,7 @@ Player* Group::GetInvited(const uint64& guid) const
|
||||
|
||||
Player* Group::GetInvited(const std::string& name) const
|
||||
{
|
||||
for(InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
for (InvitesList::const_iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
{
|
||||
if((*itr)->GetName() == name)
|
||||
return (*itr);
|
||||
@@ -383,7 +383,7 @@ void Group::Disband(bool hideDestroy)
|
||||
{
|
||||
Player *player;
|
||||
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
player = objmgr.GetPlayer(citr->guid);
|
||||
if(!player)
|
||||
@@ -486,7 +486,7 @@ void Group::SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uin
|
||||
data << uint8(RollType); // 0: "Need for: [item name]" 0: "You have selected need for [item name] 1: need roll 2: greed roll
|
||||
data << uint8(0); // 2.4.0
|
||||
|
||||
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
@@ -509,7 +509,7 @@ void Group::SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid,
|
||||
data << uint8(RollNumber); // rollnumber realted to SMSG_LOOT_ROLL
|
||||
data << uint8(RollType); // Rolltype related to SMSG_LOOT_ROLL
|
||||
|
||||
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
@@ -529,7 +529,7 @@ void Group::SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r)
|
||||
data << uint32(r.itemRandomPropId); // Item random property ID
|
||||
data << uint32(r.itemRandomSuffix); // Item random suffix ID
|
||||
|
||||
for( Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr!=r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player *p = objmgr.GetPlayer(itr->first);
|
||||
if(!p || !p->GetSession())
|
||||
@@ -564,7 +564,7 @@ void Group::GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature)
|
||||
Roll* r=new Roll(newitemGUID,*i);
|
||||
|
||||
//a vector is filled with only near party members
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
if(!member || !member->GetSession())
|
||||
@@ -603,7 +603,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
|
||||
Group *group = player->GetGroup();
|
||||
|
||||
uint8 itemSlot = 0;
|
||||
for(std::vector<LootItem>::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
|
||||
for (std::vector<LootItem>::iterator i=loot->items.begin(); i != loot->items.end(); ++i, ++itemSlot)
|
||||
{
|
||||
item = objmgr.GetItemPrototype(i->itemid);
|
||||
|
||||
@@ -613,7 +613,7 @@ void Group::NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *crea
|
||||
uint64 newitemGUID = MAKE_NEW_GUID(objmgr.GenerateLowGuid(HIGHGUID_ITEM),0,HIGHGUID_ITEM);
|
||||
Roll* r=new Roll(newitemGUID,*i);
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *playerToRoll = itr->getSource();
|
||||
if(!playerToRoll || !playerToRoll->GetSession())
|
||||
@@ -663,7 +663,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat
|
||||
WorldPacket data(SMSG_LOOT_MASTER_LIST, 330);
|
||||
data << (uint8)GetMembersCount();
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *looter = itr->getSource();
|
||||
if (!looter->IsInWorld())
|
||||
@@ -678,7 +678,7 @@ void Group::MasterLoot(const uint64& playerGUID, Loot* /*loot*/, Creature *creat
|
||||
|
||||
data.put<uint8>(0,real_count);
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *looter = itr->getSource();
|
||||
if (looter->IsWithinDist(creature,sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE),false))
|
||||
@@ -762,7 +762,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, uint32 NumberOfPlayers)
|
||||
uint64 maxguid = (*roll->playerVote.begin()).first;
|
||||
Player *player;
|
||||
|
||||
for( Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr!=roll->playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr!=roll->playerVote.end(); ++itr)
|
||||
{
|
||||
if (itr->second != NEED)
|
||||
continue;
|
||||
@@ -864,7 +864,7 @@ void Group::SetTargetIcon(uint8 id, uint64 guid)
|
||||
|
||||
// clean other icons
|
||||
if( guid != 0 )
|
||||
for(int i=0; i<TARGETICONCOUNT; ++i)
|
||||
for (int i=0; i<TARGETICONCOUNT; ++i)
|
||||
if( m_targetIcons[i] == guid )
|
||||
SetTargetIcon(i, 0);
|
||||
|
||||
@@ -879,7 +879,7 @@ void Group::SetTargetIcon(uint8 id, uint64 guid)
|
||||
|
||||
void Group::GetDataForXPAtKill(Unit const* victim, uint32& count,uint32& sum_level, Player* & member_with_max_level, Player* & not_gray_member_with_max_level)
|
||||
{
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* member = itr->getSource();
|
||||
if(!member || !member->isAlive()) // only for alive
|
||||
@@ -908,7 +908,7 @@ void Group::SendTargetIconList(WorldSession *session)
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGETICONCOUNT*9));
|
||||
data << (uint8)1;
|
||||
|
||||
for(int i=0; i<TARGETICONCOUNT; ++i)
|
||||
for (int i=0; i<TARGETICONCOUNT; ++i)
|
||||
{
|
||||
if(m_targetIcons[i] == 0)
|
||||
continue;
|
||||
@@ -924,7 +924,7 @@ void Group::SendUpdate()
|
||||
{
|
||||
Player *player;
|
||||
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
player = objmgr.GetPlayer(citr->guid);
|
||||
if(!player || !player->GetSession() || player->GetGroup() != this )
|
||||
@@ -937,7 +937,7 @@ void Group::SendUpdate()
|
||||
data << (uint8)(citr->assistant?0x01:0); // 0x2 main assist, 0x4 main tank
|
||||
data << uint64(0x50000000FFFFFFFELL); // related to voice chat?
|
||||
data << uint32(GetMembersCount()-1);
|
||||
for(member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
|
||||
for (member_citerator citr2 = m_memberSlots.begin(); citr2 != m_memberSlots.end(); ++citr2)
|
||||
{
|
||||
if(citr->guid == citr2->guid)
|
||||
continue;
|
||||
@@ -974,7 +974,7 @@ void Group::UpdatePlayerOutOfRange(Player* pPlayer)
|
||||
WorldPacket data;
|
||||
pPlayer->GetSession()->BuildPartyMemberStatsChangedPacket(pPlayer, &data);
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
player = itr->getSource();
|
||||
if (player && player != pPlayer && !pPlayer->isVisibleFor(player))
|
||||
@@ -984,7 +984,7 @@ void Group::UpdatePlayerOutOfRange(Player* pPlayer)
|
||||
|
||||
void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int group, uint64 ignore)
|
||||
{
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pl = itr->getSource();
|
||||
if(!pl || (ignore != 0 && pl->GetGUID() == ignore) || (ignorePlayersInBGRaid && pl->GetGroup() != this) )
|
||||
@@ -997,7 +997,7 @@ void Group::BroadcastPacket(WorldPacket *packet, bool ignorePlayersInBGRaid, int
|
||||
|
||||
void Group::BroadcastReadyCheck(WorldPacket *packet)
|
||||
{
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pl = itr->getSource();
|
||||
if(pl && pl->GetSession())
|
||||
@@ -1008,7 +1008,7 @@ void Group::BroadcastReadyCheck(WorldPacket *packet)
|
||||
|
||||
void Group::OfflineReadyCheck()
|
||||
{
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
Player *pl = objmgr.GetPlayer(citr->guid);
|
||||
if (!pl || !pl->GetSession())
|
||||
@@ -1083,7 +1083,7 @@ bool Group::_addMember(const uint64 &guid, const char* name, bool isAssistant, u
|
||||
|
||||
if(!isRaidGroup()) // reset targetIcons for non-raid-groups
|
||||
{
|
||||
for(int i=0; i<TARGETICONCOUNT; ++i)
|
||||
for (int i=0; i<TARGETICONCOUNT; ++i)
|
||||
m_targetIcons[i] = 0;
|
||||
}
|
||||
|
||||
@@ -1162,9 +1162,9 @@ void Group::_setLeader(const uint64 &guid)
|
||||
Player *player = objmgr.GetPlayer(slot->guid);
|
||||
if(player)
|
||||
{
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
for(BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end();)
|
||||
for (BoundInstancesMap::iterator itr = m_boundInstances[i].begin(); itr != m_boundInstances[i].end(); )
|
||||
{
|
||||
if(itr->second.perm)
|
||||
{
|
||||
@@ -1347,7 +1347,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
|
||||
// search next after current
|
||||
if(guid_itr != m_memberSlots.end())
|
||||
{
|
||||
for(member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
|
||||
for (member_citerator itr = guid_itr; itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if(Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
{
|
||||
@@ -1368,7 +1368,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
|
||||
}
|
||||
|
||||
// search from start
|
||||
for(member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr)
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != guid_itr; ++itr)
|
||||
{
|
||||
if(Player* pl = ObjectAccessor::FindPlayer(itr->guid))
|
||||
{
|
||||
@@ -1411,7 +1411,7 @@ uint32 Group::CanJoinBattleGroundQueue(BattleGroundTypeId bgTypeId, BattleGround
|
||||
uint32 team = reference->GetTeam();
|
||||
|
||||
// check every member of the group to be able to join
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *member = itr->getSource();
|
||||
// offline member? don't let join
|
||||
@@ -1454,7 +1454,7 @@ void Group::SetDifficulty(uint8 difficulty)
|
||||
m_difficulty = difficulty;
|
||||
if(!isBGGroup()) CharacterDatabase.PExecute("UPDATE groups SET difficulty = %u WHERE leaderGuid ='%u'", m_difficulty, GUID_LOPART(m_leaderGuid));
|
||||
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *player = itr->getSource();
|
||||
if(!player->GetSession() || player->getLevel() < LEVELREQUIREMENT_HEROIC)
|
||||
@@ -1466,11 +1466,11 @@ void Group::SetDifficulty(uint8 difficulty)
|
||||
|
||||
bool Group::InCombatToInstance(uint32 instanceId)
|
||||
{
|
||||
for(GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pPlayer = itr->getSource();
|
||||
if(pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaid() || pPlayer->GetMap()->IsHeroic()))
|
||||
for(std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i)
|
||||
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i!=pPlayer->getAttackers().end(); ++i)
|
||||
if((*i) && (*i)->GetTypeId() == TYPEID_UNIT && ((Creature*)(*i))->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
return true;
|
||||
}
|
||||
@@ -1487,7 +1487,7 @@ void Group::ResetInstances(uint8 method, Player* SendMsgTo)
|
||||
// we assume that when the difficulty changes, all instances that can be reset will be
|
||||
uint8 dif = GetDifficulty();
|
||||
|
||||
for(BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end();)
|
||||
for (BoundInstancesMap::iterator itr = m_boundInstances[dif].begin(); itr != m_boundInstances[dif].end(); )
|
||||
{
|
||||
InstanceSave *p = itr->second.save;
|
||||
const MapEntry *entry = sMapStore.LookupEntry(itr->first);
|
||||
@@ -1611,7 +1611,7 @@ void Group::BroadcastGroupUpdate(void)
|
||||
{
|
||||
// FG: HACK: force flags update on group leave - for values update hack
|
||||
// -- not very efficient but safe
|
||||
for(member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
|
||||
Player *pp = objmgr.GetPlayer(citr->guid);
|
||||
|
||||
+3
-3
@@ -189,7 +189,7 @@ class TRINITY_DLL_SPEC Group
|
||||
bool IsLeader(const uint64& guid) const { return (GetLeaderGUID() == guid); }
|
||||
uint64 GetMemberGUID(const std::string& name)
|
||||
{
|
||||
for(member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if(itr->name == name)
|
||||
{
|
||||
@@ -364,7 +364,7 @@ class TRINITY_DLL_SPEC Group
|
||||
|
||||
member_citerator _getMemberCSlot(uint64 Guid) const
|
||||
{
|
||||
for(member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (itr->guid == Guid)
|
||||
return itr;
|
||||
@@ -374,7 +374,7 @@ class TRINITY_DLL_SPEC Group
|
||||
|
||||
member_witerator _getMemberWSlot(uint64 Guid)
|
||||
{
|
||||
for(member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
for (member_witerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr)
|
||||
{
|
||||
if (itr->guid == Guid)
|
||||
return itr;
|
||||
|
||||
@@ -702,7 +702,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
|
||||
{
|
||||
const uint64& auramask = player->GetAuraUpdateMaskForRaid();
|
||||
*data << uint64(auramask);
|
||||
for(uint32 i = 0; i < MAX_AURAS; ++i)
|
||||
for (uint32 i = 0; i < MAX_AURAS; ++i)
|
||||
{
|
||||
if(auramask & (uint64(1) << i))
|
||||
{
|
||||
@@ -784,7 +784,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player *player, WorldPacke
|
||||
{
|
||||
const uint64& auramask = pet->GetAuraUpdateMaskForRaid();
|
||||
*data << uint64(auramask);
|
||||
for(uint32 i = 0; i < MAX_AURAS; ++i)
|
||||
for (uint32 i = 0; i < MAX_AURAS; ++i)
|
||||
{
|
||||
if(auramask & (uint64(1) << i))
|
||||
{
|
||||
@@ -844,7 +844,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
|
||||
uint64 auramask = 0;
|
||||
size_t maskPos = data.wpos();
|
||||
data << (uint64) auramask; // placeholder
|
||||
for(uint8 i = 0; i < MAX_AURAS; ++i)
|
||||
for (uint8 i = 0; i < MAX_AURAS; ++i)
|
||||
{
|
||||
if(Aura * pAura = player->GetVisibleAura(i))
|
||||
{
|
||||
@@ -870,7 +870,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode( WorldPacket &recv_data )
|
||||
uint64 petauramask = 0;
|
||||
size_t petMaskPos = data.wpos();
|
||||
data << (uint64) petauramask; // placeholder
|
||||
for(uint8 i = 0; i < MAX_AURAS; ++i)
|
||||
for (uint8 i = 0; i < MAX_AURAS; ++i)
|
||||
{
|
||||
if(Aura * pAura = pet->GetVisibleAura(i))
|
||||
{
|
||||
|
||||
@@ -136,4 +136,3 @@ void GuardAI::JustDied(Unit *killer)
|
||||
m_creature->SendZoneUnderAttackMessage(pkiller);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+4
-6
@@ -344,7 +344,7 @@ bool Guild::LoadRanksFromDB(uint32 GuildId)
|
||||
sLog.outError("Guild %u has broken `guild_rank` data, repairing...",GuildId);
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", GuildId);
|
||||
for(size_t i = 0; i < m_Ranks.size(); ++i)
|
||||
for (size_t i = 0; i < m_Ranks.size(); ++i)
|
||||
{
|
||||
std::string name = m_Ranks[i].Name;
|
||||
uint32 rights = m_Ranks[i].Rights;
|
||||
@@ -1698,7 +1698,7 @@ void Guild::AppendDisplayGuildBankSlot( WorldPacket& data, GuildBankTab const *t
|
||||
data << (uint32) pItem->GetItemRandomPropertyId(); // random item property id +8
|
||||
if (pItem->GetItemRandomPropertyId())
|
||||
data << (uint32) pItem->GetItemSuffixFactor(); // SuffixFactor +4
|
||||
|
||||
|
||||
data << uint32(pItem->GetCount()); // +12 // ITEM_FIELD_STACK_COUNT
|
||||
data << uint32(0); // +16 // Unknown value
|
||||
data << uint8(abs(pItem->GetSpellCharges())); // spell charges
|
||||
@@ -1720,7 +1720,7 @@ Item* Guild::StoreItem(uint8 tabId, GuildItemPosCountVec const& dest, Item* pIte
|
||||
|
||||
Item* lastItem = pItem;
|
||||
|
||||
for(GuildItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); )
|
||||
for (GuildItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); )
|
||||
{
|
||||
uint8 slot = itr->Slot;
|
||||
uint32 count = itr->Count;
|
||||
@@ -1838,7 +1838,7 @@ uint8 Guild::_CanStoreItem_InSpecificSlot( uint8 tab, uint8 slot, GuildItemPosCo
|
||||
|
||||
uint8 Guild::_CanStoreItem_InTab( uint8 tab, GuildItemPosCountVec &dest, uint32& count, bool merge, Item* pSrcItem, uint8 skip_slot ) const
|
||||
{
|
||||
for(uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; j++)
|
||||
for (uint32 j = 0; j < GUILD_BANK_MAX_SLOTS; j++)
|
||||
{
|
||||
// skip specific slot already processed in first called _CanStoreItem_InSpecificSlot
|
||||
if (j == skip_slot)
|
||||
@@ -2095,7 +2095,6 @@ void Guild::SwapItems(Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 BankT
|
||||
DisplayGuildBankContentUpdate(BankTabDst,BankTabSlotDst);
|
||||
}
|
||||
|
||||
|
||||
void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, uint8 PlayerBag, uint8 PlayerSlot, uint32 SplitedAmount)
|
||||
{
|
||||
Item *pItemBank = GetItem(BankTab, BankTabSlot);
|
||||
@@ -2243,7 +2242,6 @@ void Guild::MoveFromBankToChar( Player * pl, uint8 BankTab, uint8 BankTabSlot, u
|
||||
DisplayGuildBankContentUpdate(BankTab,BankTabSlot);
|
||||
}
|
||||
|
||||
|
||||
void Guild::MoveFromCharToBank( Player * pl, uint8 PlayerBag, uint8 PlayerSlot, uint8 BankTab, uint8 BankTabSlot, uint32 SplitedAmount )
|
||||
{
|
||||
Item *pItemBank = GetItem(BankTab, BankTabSlot);
|
||||
|
||||
+3
-5
@@ -268,7 +268,7 @@ struct RankInfo
|
||||
{
|
||||
RankInfo(const std::string& _name, uint32 _rights, uint32 _money) : Name(_name), Rights(_rights), BankMoneyPerDay(_money)
|
||||
{
|
||||
for(uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||
{
|
||||
TabRight[i] = 0;
|
||||
TabSlotPerDay[i] = 0;
|
||||
@@ -301,12 +301,10 @@ class Guild
|
||||
std::string const& GetMOTD() const { return MOTD; }
|
||||
std::string const& GetGINFO() const { return GINFO; }
|
||||
|
||||
|
||||
uint32 GetCreatedYear() const { return m_CreatedYear; }
|
||||
uint32 GetCreatedMonth() const { return m_CreatedMonth; }
|
||||
uint32 GetCreatedDay() const { return m_CreatedDay; }
|
||||
|
||||
|
||||
uint32 GetEmblemStyle() const { return m_EmblemStyle; }
|
||||
uint32 GetEmblemColor() const { return m_EmblemColor; }
|
||||
uint32 GetBorderStyle() const { return m_BorderStyle; }
|
||||
@@ -342,7 +340,7 @@ class Guild
|
||||
template<class Do>
|
||||
void BroadcastWorker(Do& _do, Player* except = NULL)
|
||||
{
|
||||
for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
if(Player *player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
|
||||
if(player != except)
|
||||
_do(player);
|
||||
@@ -367,7 +365,7 @@ class Guild
|
||||
}
|
||||
MemberSlot* GetMemberSlot(const std::string& name, uint64& guid)
|
||||
{
|
||||
for(MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
for (MemberList::iterator itr = members.begin(); itr != members.end(); ++itr)
|
||||
{
|
||||
if(itr->second.Name == name)
|
||||
{
|
||||
|
||||
@@ -324,7 +324,7 @@ void WorldSession::HandleGuildPromoteOpcode(WorldPacket& recvPacket)
|
||||
data << plName;
|
||||
data << guild->GetRankName(newRankId);
|
||||
guild->BroadcastPacket(&data);
|
||||
|
||||
|
||||
guild->ChangeRank(plGuid, newRankId);
|
||||
// Put record into guildlog
|
||||
guild->LogGuildEvent(GUILD_EVENT_LOG_PROMOTE_PLAYER, GetPlayer()->GetGUIDLow(), GUID_LOPART(plGuid), newRankId);
|
||||
@@ -893,7 +893,7 @@ void WorldSession::HandleGuildPermissions( WorldPacket& /* recv_data */ )
|
||||
data << uint32(pGuild->GetMemberMoneyWithdrawRem(GetPlayer()->GetGUIDLow()));
|
||||
data << uint8(pGuild->GetPurchasedTabs()); // tabs count
|
||||
// why sending all info when not all tabs are purchased???
|
||||
for(int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||
for (int i = 0; i < GUILD_BANK_MAX_TABS; ++i)
|
||||
{
|
||||
data << uint32(pGuild->GetBankRights(rankId, uint8(i)));
|
||||
data << uint32(pGuild->GetMemberSlotWithdrawRem(GetPlayer()->GetGUIDLow(), uint8(i)));
|
||||
|
||||
@@ -47,7 +47,7 @@ class TRINITY_DLL_SPEC HomeMovementGenerator<Creature>
|
||||
MovementGeneratorType GetMovementGeneratorType() { return HOME_MOTION_TYPE; }
|
||||
|
||||
bool GetDestination(float& x, float& y, float& z) const { i_destinationHolder.GetDestination(x,y,z); return true; }
|
||||
|
||||
|
||||
private:
|
||||
void _setTargetLocation(Creature &);
|
||||
DestinationHolder< Traveller<Creature> > i_destinationHolder;
|
||||
|
||||
@@ -49,7 +49,7 @@ void RotateMovementGenerator::Initialize(Unit& owner)
|
||||
|
||||
owner.addUnitState(UNIT_STAT_ROTATING);
|
||||
|
||||
owner.AttackStop();
|
||||
owner.AttackStop();
|
||||
}
|
||||
|
||||
bool RotateMovementGenerator::Update(Unit& owner, const uint32& diff)
|
||||
|
||||
+12
-12
@@ -47,7 +47,7 @@ void InstanceData::HandleGameObject(uint64 GUID, bool open, GameObject *go)
|
||||
|
||||
bool InstanceData::IsEncounterInProgress() const
|
||||
{
|
||||
for(std::vector<BossInfo>::const_iterator itr = bosses.begin(); itr != bosses.end(); ++itr)
|
||||
for (std::vector<BossInfo>::const_iterator itr = bosses.begin(); itr != bosses.end(); ++itr)
|
||||
if(itr->state == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
@@ -105,7 +105,7 @@ void InstanceData::UpdateDoorState(GameObject *door)
|
||||
return;
|
||||
|
||||
bool open = true;
|
||||
for(DoorInfoMap::iterator itr = lower; itr != upper; ++itr)
|
||||
for (DoorInfoMap::iterator itr = lower; itr != upper; ++itr)
|
||||
{
|
||||
if(itr->second.type == DOOR_TYPE_ROOM)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ void InstanceData::AddDoor(GameObject *door, bool add)
|
||||
if(lower == upper)
|
||||
return;
|
||||
|
||||
for(DoorInfoMap::iterator itr = lower; itr != upper; ++itr)
|
||||
for (DoorInfoMap::iterator itr = lower; itr != upper; ++itr)
|
||||
{
|
||||
if(add)
|
||||
{
|
||||
@@ -201,19 +201,19 @@ bool InstanceData::SetBossState(uint32 id, EncounterState state)
|
||||
return false;
|
||||
|
||||
if(state == DONE)
|
||||
for(MinionSet::iterator i = bossInfo->minion.begin(); i != bossInfo->minion.end(); ++i)
|
||||
for (MinionSet::iterator i = bossInfo->minion.begin(); i != bossInfo->minion.end(); ++i)
|
||||
if((*i)->isWorldBoss() && (*i)->isAlive())
|
||||
return false;
|
||||
|
||||
bossInfo->state = state;
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
for(uint32 type = 0; type < MAX_DOOR_TYPES; ++type)
|
||||
for(DoorSet::iterator i = bossInfo->door[type].begin(); i != bossInfo->door[type].end(); ++i)
|
||||
|
||||
for (uint32 type = 0; type < MAX_DOOR_TYPES; ++type)
|
||||
for (DoorSet::iterator i = bossInfo->door[type].begin(); i != bossInfo->door[type].end(); ++i)
|
||||
UpdateDoorState(*i);
|
||||
|
||||
for(MinionSet::iterator i = bossInfo->minion.begin(); i != bossInfo->minion.end(); ++i)
|
||||
for (MinionSet::iterator i = bossInfo->minion.begin(); i != bossInfo->minion.end(); ++i)
|
||||
UpdateMinionState(*i, state);
|
||||
|
||||
return true;
|
||||
@@ -227,7 +227,7 @@ std::string InstanceData::LoadBossState(const char * data)
|
||||
std::istringstream loadStream(data);
|
||||
uint32 buff;
|
||||
uint32 bossId = 0;
|
||||
for(std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i, ++bossId)
|
||||
for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i, ++bossId)
|
||||
{
|
||||
loadStream >> buff;
|
||||
if(buff < TO_BE_DECIDED)
|
||||
@@ -239,10 +239,10 @@ std::string InstanceData::LoadBossState(const char * data)
|
||||
std::string InstanceData::GetBossSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
for(std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i)
|
||||
for (std::vector<BossInfo>::iterator i = bosses.begin(); i != bosses.end(); ++i)
|
||||
saveStream << (uint32)i->state << " ";
|
||||
return saveStream.str();
|
||||
}
|
||||
}
|
||||
|
||||
void InstanceData::DoUseDoorOrButton(uint64 uiGuid, uint32 uiWithRestoreTime, bool bUseAlternativeState)
|
||||
{
|
||||
@@ -287,7 +287,7 @@ void InstanceData::DoUpdateWorldState(uint32 uiStateId, uint32 uiStateData)
|
||||
|
||||
if (!lPlayers.isEmpty())
|
||||
{
|
||||
for(Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
for (Map::PlayerList::const_iterator itr = lPlayers.begin(); itr != lPlayers.end(); ++itr)
|
||||
{
|
||||
if (Player* pPlayer = itr->getSource())
|
||||
pPlayer->SendUpdateWorldState(uiStateId, uiStateData);
|
||||
|
||||
@@ -57,13 +57,13 @@ InstanceSaveManager::~InstanceSaveManager()
|
||||
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
|
||||
{
|
||||
InstanceSave *save = itr->second;
|
||||
for(InstanceSave::PlayerListType::iterator itr2 = save->m_playerList.begin(), next = itr2; itr2 != save->m_playerList.end(); itr2 = next)
|
||||
for (InstanceSave::PlayerListType::iterator itr2 = save->m_playerList.begin(), next = itr2; itr2 != save->m_playerList.end(); itr2 = next)
|
||||
{
|
||||
++next;
|
||||
(*itr2)->UnbindInstance(save->GetMapId(), save->GetDifficulty(), true);
|
||||
}
|
||||
save->m_playerList.clear();
|
||||
for(InstanceSave::GroupListType::iterator itr2 = save->m_groupList.begin(), next = itr2; itr2 != save->m_groupList.end(); itr2 = next)
|
||||
for (InstanceSave::GroupListType::iterator itr2 = save->m_groupList.begin(), next = itr2; itr2 != save->m_groupList.end(); itr2 = next)
|
||||
{
|
||||
++next;
|
||||
(*itr2)->UnbindInstance(save->GetMapId(), save->GetDifficulty(), true);
|
||||
@@ -233,7 +233,7 @@ void InstanceSaveManager::_DelHelper(DatabaseType &db, const char *fields, const
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
std::ostringstream ss;
|
||||
for(size_t i = 0; i < fieldTokens.size(); i++)
|
||||
for (size_t i = 0; i < fieldTokens.size(); i++)
|
||||
{
|
||||
std::string fieldValue = fields[i].GetCppString();
|
||||
db.escape_string(fieldValue);
|
||||
@@ -440,7 +440,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
}
|
||||
|
||||
// schedule the reset times
|
||||
for(ResetTimeMapType::iterator itr = InstResetTime.begin(); itr != InstResetTime.end(); ++itr)
|
||||
for (ResetTimeMapType::iterator itr = InstResetTime.begin(); itr != InstResetTime.end(); ++itr)
|
||||
if(itr->second.second > now)
|
||||
ScheduleReset(true, itr->second.second, InstResetEvent(0, itr->second.first, itr->first));
|
||||
}
|
||||
@@ -479,7 +479,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
|
||||
// calculate new global reset times for expired instances and those that have never been reset yet
|
||||
// add the global reset times to the priority queue
|
||||
for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
|
||||
for (uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
|
||||
{
|
||||
InstanceTemplate const* temp = objmgr.GetInstanceTemplate(i);
|
||||
if(!temp) continue;
|
||||
@@ -512,7 +512,7 @@ void InstanceSaveManager::LoadResetTimes()
|
||||
// schedule the global reset/warning
|
||||
uint8 type = 1;
|
||||
static int tim[4] = {3600, 900, 300, 60};
|
||||
for(; type < 4; type++)
|
||||
for (; type < 4; type++)
|
||||
if(t - tim[type-1] > now) break;
|
||||
ScheduleReset(true, t - tim[type-1], InstResetEvent(type, i));
|
||||
}
|
||||
@@ -527,12 +527,12 @@ void InstanceSaveManager::ScheduleReset(bool add, time_t time, InstResetEvent ev
|
||||
ResetTimeQueue::iterator itr;
|
||||
std::pair<ResetTimeQueue::iterator, ResetTimeQueue::iterator> range;
|
||||
range = m_resetTimeQueue.equal_range(time);
|
||||
for(itr = range.first; itr != range.second; ++itr)
|
||||
for (itr = range.first; itr != range.second; ++itr)
|
||||
if(itr->second == event) { m_resetTimeQueue.erase(itr); return; }
|
||||
// in case the reset time changed (should happen very rarely), we search the whole queue
|
||||
if(itr == range.second)
|
||||
{
|
||||
for(itr = m_resetTimeQueue.begin(); itr != m_resetTimeQueue.end(); ++itr)
|
||||
for (itr = m_resetTimeQueue.begin(); itr != m_resetTimeQueue.end(); ++itr)
|
||||
if(itr->second == event) { m_resetTimeQueue.erase(itr); return; }
|
||||
if(itr == m_resetTimeQueue.end())
|
||||
sLog.outError("InstanceSaveManager::ScheduleReset: cannot cancel the reset, the event(%d,%d,%d) was not found!", event.type, event.mapid, event.instanceId);
|
||||
@@ -627,7 +627,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
|
||||
}
|
||||
|
||||
// remove all binds to instances of the given map
|
||||
for(InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end();)
|
||||
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); )
|
||||
{
|
||||
if(itr->second->GetMapId() == mapid)
|
||||
_ResetSave(itr);
|
||||
@@ -656,7 +656,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
|
||||
|
||||
MapInstanced::InstancedMaps &instMaps = ((MapInstanced*)map)->GetInstancedMaps();
|
||||
MapInstanced::InstancedMaps::iterator mitr;
|
||||
for(mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
|
||||
for (mitr = instMaps.begin(); mitr != instMaps.end(); ++mitr)
|
||||
{
|
||||
Map *map2 = mitr->second;
|
||||
if(!map2->IsDungeon()) continue;
|
||||
@@ -670,7 +670,7 @@ void InstanceSaveManager::_ResetOrWarnAll(uint32 mapid, bool warn, uint32 timeLe
|
||||
uint32 InstanceSaveManager::GetNumBoundPlayersTotal()
|
||||
{
|
||||
uint32 ret = 0;
|
||||
for(InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
|
||||
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
|
||||
ret += itr->second->GetPlayerCount();
|
||||
return ret;
|
||||
}
|
||||
@@ -678,7 +678,7 @@ uint32 InstanceSaveManager::GetNumBoundPlayersTotal()
|
||||
uint32 InstanceSaveManager::GetNumBoundGroupsTotal()
|
||||
{
|
||||
uint32 ret = 0;
|
||||
for(InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
|
||||
for (InstanceSaveHashMap::iterator itr = m_instanceSaveById.begin(); itr != m_instanceSaveById.end(); ++itr)
|
||||
ret += itr->second->GetGroupCount();
|
||||
return ret;
|
||||
}
|
||||
|
||||
+21
-21
@@ -45,7 +45,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
|
||||
ItemSetEffect *eff = NULL;
|
||||
|
||||
for(size_t x = 0; x < player->ItemSetEff.size(); ++x)
|
||||
for (size_t x = 0; x < player->ItemSetEff.size(); ++x)
|
||||
{
|
||||
if(player->ItemSetEff[x] && player->ItemSetEff[x]->setid == setid)
|
||||
{
|
||||
@@ -61,7 +61,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
eff->setid = setid;
|
||||
|
||||
size_t x = 0;
|
||||
for(; x < player->ItemSetEff.size(); x++)
|
||||
for (; x < player->ItemSetEff.size(); x++)
|
||||
if(!player->ItemSetEff[x])
|
||||
break;
|
||||
|
||||
@@ -73,7 +73,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
|
||||
++eff->item_count;
|
||||
|
||||
for(uint32 x=0;x<8;x++)
|
||||
for (uint32 x=0; x<8; x++)
|
||||
{
|
||||
if(!set->spells [x])
|
||||
continue;
|
||||
@@ -82,7 +82,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
continue;
|
||||
|
||||
uint32 z=0;
|
||||
for(;z<8;z++)
|
||||
for (; z<8; z++)
|
||||
if(eff->spells[z] && eff->spells[z]->Id==set->spells[x])
|
||||
break;
|
||||
|
||||
@@ -90,7 +90,7 @@ void AddItemsSetItem(Player*player,Item *item)
|
||||
continue;
|
||||
|
||||
//new spell
|
||||
for(uint32 y=0;y<8;y++)
|
||||
for (uint32 y=0; y<8; y++)
|
||||
{
|
||||
if(!eff->spells[y]) // free slot
|
||||
{
|
||||
@@ -124,7 +124,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
|
||||
|
||||
ItemSetEffect *eff = NULL;
|
||||
size_t setindex = 0;
|
||||
for(;setindex < player->ItemSetEff.size(); setindex++)
|
||||
for (; setindex < player->ItemSetEff.size(); setindex++)
|
||||
{
|
||||
if(player->ItemSetEff[setindex] && player->ItemSetEff[setindex]->setid == setid)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
|
||||
|
||||
--eff->item_count;
|
||||
|
||||
for(uint32 x=0;x<8;x++)
|
||||
for (uint32 x=0; x<8; x++)
|
||||
{
|
||||
if(!set->spells[x])
|
||||
continue;
|
||||
@@ -148,7 +148,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
|
||||
if(set->items_to_triggerspell[x] <= eff->item_count)
|
||||
continue;
|
||||
|
||||
for(uint32 z=0;z<8;z++)
|
||||
for (uint32 z=0; z<8; z++)
|
||||
{
|
||||
if(eff->spells[z] && eff->spells[z]->Id==set->spells[x])
|
||||
{
|
||||
@@ -267,7 +267,7 @@ bool Item::Create( uint32 guidlow, uint32 itemid, Player const* owner)
|
||||
SetUInt32Value(ITEM_FIELD_MAXDURABILITY, itemProto->MaxDurability);
|
||||
SetUInt32Value(ITEM_FIELD_DURABILITY, itemProto->MaxDurability);
|
||||
|
||||
for(uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
SetSpellCharges(i,itemProto->Spells[i].SpellCharges);
|
||||
|
||||
SetUInt32Value(ITEM_FIELD_FLAGS, itemProto->Flags);
|
||||
@@ -286,7 +286,7 @@ void Item::UpdateDuration(Player* owner, uint32 diff)
|
||||
if (GetUInt32Value(ITEM_FIELD_DURATION)<=diff)
|
||||
{
|
||||
Script->ItemExpire(owner, GetProto());
|
||||
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
|
||||
owner->DestroyItem(GetBagSlot(), GetSlot(), true);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ void Item::SaveToDB()
|
||||
CharacterDatabase.PExecute( "DELETE FROM item_instance WHERE guid = '%u'", guid );
|
||||
std::ostringstream ss;
|
||||
ss << "INSERT INTO item_instance (guid,owner_guid,data) VALUES (" << guid << "," << GUID_LOPART(GetOwnerGUID()) << ",'";
|
||||
for(uint16 i = 0; i < m_valuesCount; ++i )
|
||||
for (uint16 i = 0; i < m_valuesCount; ++i )
|
||||
ss << GetUInt32Value(i) << " ";
|
||||
ss << "' )";
|
||||
CharacterDatabase.Execute( ss.str().c_str() );
|
||||
@@ -313,7 +313,7 @@ void Item::SaveToDB()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "UPDATE item_instance SET data = '";
|
||||
for(uint16 i = 0; i < m_valuesCount; ++i )
|
||||
for (uint16 i = 0; i < m_valuesCount; ++i )
|
||||
ss << GetUInt32Value(i) << " ";
|
||||
ss << "', owner_guid = '" << GUID_LOPART(GetOwnerGUID()) << "' WHERE guid = '" << guid << "'";
|
||||
|
||||
@@ -424,7 +424,7 @@ bool Item::LoadFromDB(uint32 guid, uint64 owner_guid, QueryResult *result)
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss << "UPDATE item_instance SET data = '";
|
||||
for(uint16 i = 0; i < m_valuesCount; ++i )
|
||||
for (uint16 i = 0; i < m_valuesCount; ++i )
|
||||
ss << GetUInt32Value(i) << " ";
|
||||
ss << "', owner_guid = '" << GUID_LOPART(GetOwnerGUID()) << "' WHERE guid = '" << guid << "'";
|
||||
|
||||
@@ -592,7 +592,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
||||
SetInt32Value(ITEM_FIELD_RANDOM_PROPERTIES_ID,item_rand->ID);
|
||||
SetState(ITEM_CHANGED);
|
||||
}
|
||||
for(uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i)
|
||||
for (uint32 i = PROP_ENCHANTMENT_SLOT_2; i < PROP_ENCHANTMENT_SLOT_2 + 3; ++i)
|
||||
SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_2],0,0);
|
||||
}
|
||||
}
|
||||
@@ -609,7 +609,7 @@ void Item::SetItemRandomProperties(int32 randomPropId)
|
||||
SetState(ITEM_CHANGED);
|
||||
}
|
||||
|
||||
for(uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i)
|
||||
for (uint32 i = PROP_ENCHANTMENT_SLOT_0; i < PROP_ENCHANTMENT_SLOT_0 + 3; ++i)
|
||||
SetEnchantment(EnchantmentSlot(i),item_rand->enchant_id[i - PROP_ENCHANTMENT_SLOT_0],0,0);
|
||||
}
|
||||
}
|
||||
@@ -736,7 +736,7 @@ bool Item::CanBeTraded(bool mail) const
|
||||
bool Item::IsBoundByEnchant() const
|
||||
{
|
||||
// Check all enchants for soulbound
|
||||
for(uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
|
||||
for (uint32 enchant_slot = PERM_ENCHANTMENT_SLOT; enchant_slot < MAX_ENCHANTMENT_SLOT; ++enchant_slot)
|
||||
{
|
||||
uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
|
||||
if(!enchant_id)
|
||||
@@ -798,7 +798,7 @@ bool Item::IsTargetValidForItemUse(Unit* pUnitTarget)
|
||||
if (!pUnitTarget)
|
||||
return false;
|
||||
|
||||
for(ItemRequiredTargetMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
for (ItemRequiredTargetMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr)
|
||||
if(itr->second.IsFitToRequirements(pUnitTarget))
|
||||
return true;
|
||||
|
||||
@@ -840,7 +840,7 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
|
||||
if(!GetEnchantmentId(slot))
|
||||
return;
|
||||
|
||||
for(uint8 x = 0; x < 3; ++x)
|
||||
for (uint8 x = 0; x < 3; ++x)
|
||||
SetUInt32Value(ITEM_FIELD_ENCHANTMENT_1_1 + slot*MAX_ENCHANTMENT_OFFSET + x, 0);
|
||||
SetState(ITEM_CHANGED);
|
||||
}
|
||||
@@ -848,7 +848,7 @@ void Item::ClearEnchantment(EnchantmentSlot slot)
|
||||
bool Item::GemsFitSockets() const
|
||||
{
|
||||
bool fits = true;
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
{
|
||||
uint8 SocketColor = GetProto()->Socket[enchant_slot-SOCK_ENCHANTMENT_SLOT].Color;
|
||||
|
||||
@@ -888,7 +888,7 @@ bool Item::GemsFitSockets() const
|
||||
uint8 Item::GetGemCountWithID(uint32 GemID) const
|
||||
{
|
||||
uint8 count = 0;
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
{
|
||||
uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
|
||||
if(!enchant_id)
|
||||
@@ -907,7 +907,7 @@ uint8 Item::GetGemCountWithID(uint32 GemID) const
|
||||
uint8 Item::GetGemCountWithLimitCategory(uint32 limitCategory) const
|
||||
{
|
||||
uint8 count = 0;
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
{
|
||||
uint32 enchant_id = GetEnchantmentId(EnchantmentSlot(enchant_slot));
|
||||
if(!enchant_id)
|
||||
|
||||
@@ -103,7 +103,7 @@ uint32 GetItemEnchantMod(uint32 entry)
|
||||
double dRoll = rand_chance();
|
||||
float fCount = 0;
|
||||
|
||||
for(EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
||||
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
||||
{
|
||||
fCount += ench_iter->chance;
|
||||
|
||||
@@ -114,7 +114,7 @@ uint32 GetItemEnchantMod(uint32 entry)
|
||||
dRoll = (irand(0, (int)floor(fCount * 100) + 1)) / 100;
|
||||
fCount = 0;
|
||||
|
||||
for(EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
||||
for (EnchStoreList::const_iterator ench_iter = tab->second.begin(); ench_iter != tab->second.end(); ++ench_iter)
|
||||
{
|
||||
fCount += ench_iter->chance;
|
||||
|
||||
|
||||
+15
-15
@@ -337,14 +337,14 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
|
||||
data << int32(pProto->Stackable);
|
||||
data << pProto->ContainerSlots;
|
||||
data << pProto->StatsCount; // item stats count
|
||||
for(uint32 i = 0; i < pProto->StatsCount; ++i)
|
||||
for (uint32 i = 0; i < pProto->StatsCount; ++i)
|
||||
{
|
||||
data << pProto->ItemStat[i].ItemStatType;
|
||||
data << pProto->ItemStat[i].ItemStatValue;
|
||||
}
|
||||
data << pProto->ScalingStatDistribution; // scaling stats distribution
|
||||
data << pProto->ScalingStatValue; // some kind of flags used to determine stat values column
|
||||
for(int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
for (int i = 0; i < MAX_ITEM_PROTO_DAMAGES; ++i)
|
||||
{
|
||||
data << pProto->Damage[i].DamageMin;
|
||||
data << pProto->Damage[i].DamageMax;
|
||||
@@ -364,7 +364,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
|
||||
data << pProto->AmmoType;
|
||||
data << pProto->RangedModRange;
|
||||
|
||||
for(int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
for (int s = 0; s < MAX_ITEM_PROTO_SPELLS; ++s)
|
||||
{
|
||||
// send DBC data for cooldowns in same way as it used in Spell::SendSpellCooldown
|
||||
// use `item_template` or if not set then only use spell cooldowns
|
||||
@@ -418,7 +418,7 @@ void WorldSession::HandleItemQuerySingleOpcode( WorldPacket & recv_data )
|
||||
data << pProto->Map; // Added in 1.12.x & 2.0.1 client branch
|
||||
data << pProto->BagFamily;
|
||||
data << pProto->TotemCategory;
|
||||
for(int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s)
|
||||
for (int s = 0; s < MAX_ITEM_PROTO_SOCKETS; ++s)
|
||||
{
|
||||
data << pProto->Socket[s].Color;
|
||||
data << pProto->Socket[s].Content;
|
||||
@@ -656,7 +656,7 @@ void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||
bag = INVENTORY_SLOT_BAG_0;
|
||||
else
|
||||
{
|
||||
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END;++i)
|
||||
for (int i = INVENTORY_SLOT_BAG_START; i < INVENTORY_SLOT_BAG_END; ++i)
|
||||
{
|
||||
if (Bag *pBag = (Bag*)_player->GetItemByPos(INVENTORY_SLOT_BAG_0,i))
|
||||
{
|
||||
@@ -737,7 +737,7 @@ void WorldSession::SendListInventory( uint64 vendorguid )
|
||||
|
||||
float discountMod = _player->GetReputationPriceDiscount(pCreature);
|
||||
|
||||
for(int i = 0; i < numitems; ++i )
|
||||
for (int i = 0; i < numitems; ++i )
|
||||
{
|
||||
if(VendorItem const* crItem = vItems->GetItem(i))
|
||||
{
|
||||
@@ -1123,7 +1123,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
if(!item_guid)
|
||||
return;
|
||||
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
recv_data >> gem_guids[i];
|
||||
|
||||
//cheat -> tried to socket same gem multiple times
|
||||
@@ -1143,14 +1143,14 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
uint8 slot = itemTarget->IsEquipped() ? itemTarget->GetSlot() : uint8(NULL_SLOT);
|
||||
|
||||
Item *Gems[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
Gems[i] = gem_guids[i] ? _player->GetItemByGuid(gem_guids[i]) : NULL;
|
||||
|
||||
GemPropertiesEntry const *GemProps[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get geminfo from dbc storage
|
||||
GemProps[i] = (Gems[i]) ? sGemPropertiesStore.LookupEntry(Gems[i]->GetProto()->GemProperties) : NULL;
|
||||
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //check for hack maybe
|
||||
{
|
||||
if (!GemProps[i])
|
||||
continue;
|
||||
@@ -1180,14 +1180,14 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
|
||||
uint32 GemEnchants[MAX_GEM_SOCKETS];
|
||||
uint32 OldEnchants[MAX_GEM_SOCKETS];
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i) //get new and old enchantments
|
||||
{
|
||||
GemEnchants[i] = (GemProps[i]) ? GemProps[i]->spellitemenchantement : 0;
|
||||
OldEnchants[i] = itemTarget->GetEnchantmentId(EnchantmentSlot(SOCK_ENCHANTMENT_SLOT+i));
|
||||
}
|
||||
|
||||
// check unique-equipped conditions
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
{
|
||||
if(!Gems[i])
|
||||
continue;
|
||||
@@ -1284,10 +1284,10 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
//if a meta gem is being equipped, all information has to be written to the item before testing if the conditions for the gem are met
|
||||
|
||||
//remove ALL enchants
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),false);
|
||||
|
||||
for(int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
for (int i = 0; i < MAX_GEM_SOCKETS; ++i)
|
||||
{
|
||||
if(GemEnchants[i])
|
||||
{
|
||||
@@ -1297,7 +1297,7 @@ void WorldSession::HandleSocketOpcode(WorldPacket& recv_data)
|
||||
}
|
||||
}
|
||||
|
||||
for(uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
for (uint32 enchant_slot = SOCK_ENCHANTMENT_SLOT; enchant_slot < SOCK_ENCHANTMENT_SLOT+MAX_GEM_SOCKETS; ++enchant_slot)
|
||||
_player->ApplyEnchantment(itemTarget,EnchantmentSlot(enchant_slot),true);
|
||||
|
||||
bool SocketBonusToBeActivated = itemTarget->GemsFitSockets();//current socketbonus state
|
||||
|
||||
@@ -34,7 +34,7 @@ static void AttemptJoin(Player* _player)
|
||||
|
||||
//TODO: Guard Player Map
|
||||
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
{
|
||||
Player *plr = iter->second;
|
||||
|
||||
@@ -94,7 +94,7 @@ static void AttemptAddMore(Player* _player)
|
||||
|
||||
//TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
{
|
||||
Player *plr = iter->second;
|
||||
|
||||
@@ -188,7 +188,7 @@ void WorldSession::HandleLfgClearOpcode( WorldPacket & /*recv_data */ )
|
||||
// empty packet
|
||||
sLog.outDebug("CMSG_CLEAR_LOOKING_FOR_GROUP");
|
||||
|
||||
for(int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
for (int i = 0; i < MAX_LOOKING_FOR_GROUP_SLOT; ++i)
|
||||
_player->m_lookingForGroup.slots[i].Clear();
|
||||
|
||||
if( sWorld.getConfig(CONFIG_RESTRICTED_LFG_CHANNEL) && _player->GetSession()->GetSecurity() == SEC_PLAYER )
|
||||
@@ -305,7 +305,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
|
||||
//TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType const& players = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator iter = players.begin(); iter != players.end(); ++iter)
|
||||
{
|
||||
Player *plr = iter->second;
|
||||
|
||||
@@ -331,7 +331,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
data << uint8(plr->getClass());
|
||||
data << uint8(plr->getRace());
|
||||
|
||||
for(int i = 0; i < 3; ++i)
|
||||
for (int i = 0; i < 3; ++i)
|
||||
data << uint8(0); // spent talents count in specific tab
|
||||
|
||||
data << uint32(0); // resistances1
|
||||
@@ -379,7 +379,7 @@ void WorldSession::SendLfgResult(uint32 type, uint32 entry, uint8 lfg_type)
|
||||
|
||||
if(flags & 0x80)
|
||||
{
|
||||
for(uint8 j = 0; j < MAX_LOOKING_FOR_GROUP_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_LOOKING_FOR_GROUP_SLOT; ++j)
|
||||
{
|
||||
data << uint32(plr->m_lookingForGroup.slots[j].entry | (plr->m_lookingForGroup.slots[j].type << 24));
|
||||
}
|
||||
|
||||
@@ -878,7 +878,6 @@ enum TrinityStrings
|
||||
LANG_WORLD_CLOSED = 7523,
|
||||
LANG_WORLD_OPENED = 7524,
|
||||
|
||||
|
||||
// Use for not-in-offcial-sources patches
|
||||
// 10000-10999
|
||||
// opvp hp
|
||||
|
||||
+2
-2
@@ -78,7 +78,7 @@ bool ChatHandler::HandleStartCommand(const char* /*args*/)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if((chr->isDead()) || (chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST)))
|
||||
{
|
||||
// if player is dead and stuck, send ghost to graveyard
|
||||
@@ -168,7 +168,7 @@ bool ChatHandler::HandleGMListIngameCommand(const char* /*args*/)
|
||||
|
||||
HashMapHolder<Player>::MapType &m = HashMapHolder<Player>::GetContainer();
|
||||
HashMapHolder<Player>::MapType::const_iterator itr = m.begin();
|
||||
for(; itr != m.end(); ++itr)
|
||||
for (; itr != m.end(); ++itr)
|
||||
{
|
||||
AccountTypes itr_sec = itr->second->GetSession()->GetSecurity();
|
||||
if ((itr->second->isGameMaster() || (itr_sec > SEC_PLAYER && itr_sec <= sWorld.getConfig(CONFIG_GM_LEVEL_IN_GM_LIST))) &&
|
||||
|
||||
+9
-13
@@ -297,7 +297,7 @@ std::string ChatHandler::PGetParseString(int32 entry, ...)
|
||||
bool ChatHandler::HandleGMTicketListCommand(const char* args)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWLIST);
|
||||
for(GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if((*itr)->closed != 0)
|
||||
continue;
|
||||
@@ -316,11 +316,10 @@ bool ChatHandler::HandleGMTicketListCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ChatHandler::HandleGMTicketListOnlineCommand(const char* args)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWONLINELIST);
|
||||
for(GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if((*itr)->closed != 0 || !objmgr.GetPlayer((*itr)->playerGuid))
|
||||
continue;
|
||||
@@ -343,7 +342,7 @@ bool ChatHandler::HandleGMTicketListOnlineCommand(const char* args)
|
||||
bool ChatHandler::HandleGMTicketListClosedCommand(const char* args)
|
||||
{
|
||||
SendSysMessage(LANG_COMMAND_TICKETSHOWCLOSEDLIST);
|
||||
for(GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
for (GmTicketList::iterator itr = objmgr.m_GMTicketList.begin(); itr != objmgr.m_GMTicketList.end(); ++itr)
|
||||
{
|
||||
if((*itr)->closed == 0)
|
||||
continue;
|
||||
@@ -409,7 +408,7 @@ bool ChatHandler::HandleGMTicketGetByNameCommand(const char* args)
|
||||
SendSysMessage(LANG_NO_PLAYERS_FOUND);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
GM_Ticket *ticket = objmgr.GetGMTicketByPlayer(plr->GetGUID());
|
||||
if(!ticket)
|
||||
{
|
||||
@@ -682,8 +681,6 @@ bool ChatHandler::HandleGMVisibleCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool ChatHandler::HandleGPSCommand(const char* args)
|
||||
{
|
||||
WorldObject *obj = NULL;
|
||||
@@ -909,7 +906,6 @@ bool ChatHandler::HandleGonameCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (target)
|
||||
{
|
||||
// check online security
|
||||
@@ -1094,7 +1090,7 @@ bool ChatHandler::HandleModifyKnownTitlesCommand(const char* args)
|
||||
|
||||
uint64 titles2 = titles;
|
||||
|
||||
for(uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sCharTitlesStore.GetNumRows(); ++i)
|
||||
if(CharTitlesEntry const* tEntry = sCharTitlesStore.LookupEntry(i))
|
||||
titles2 &= ~(uint64(1) << tEntry->bit_index);
|
||||
|
||||
@@ -2289,7 +2285,7 @@ bool ChatHandler::HandleLookupAreaCommand(const char* args)
|
||||
if (!Utf8FitTo (name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if (loc==GetSessionDbcLocale ())
|
||||
continue;
|
||||
@@ -2352,7 +2348,7 @@ bool ChatHandler::HandleLookupTeleCommand(const char * args)
|
||||
std::ostringstream reply;
|
||||
|
||||
GameTeleMap const & teleMap = objmgr.GetGameTeleMap();
|
||||
for(GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
for (GameTeleMap::const_iterator itr = teleMap.begin(); itr != teleMap.end(); ++itr)
|
||||
{
|
||||
GameTele const* tele = &itr->second;
|
||||
|
||||
@@ -2582,7 +2578,7 @@ bool ChatHandler::HandleTeleGroupCommand(const char * args)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pl = itr->getSource();
|
||||
|
||||
@@ -2657,7 +2653,7 @@ bool ChatHandler::HandleGroupgoCommand(const char* args)
|
||||
return false;
|
||||
}
|
||||
|
||||
for(GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = grp->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pl = itr->getSource();
|
||||
|
||||
|
||||
+12
-22
@@ -57,7 +57,7 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
std::string mutereasonstr = "No reason";
|
||||
if(mutereason != NULL)
|
||||
mutereasonstr = mutereason;
|
||||
|
||||
|
||||
Player* target;
|
||||
uint64 target_guid;
|
||||
std::string target_name;
|
||||
@@ -68,10 +68,8 @@ bool ChatHandler::HandleMuteCommand(const char* args)
|
||||
|
||||
// find only player from same account if any
|
||||
if(!target)
|
||||
{
|
||||
if(WorldSession* session = sWorld.FindSession(account_id))
|
||||
target = session->GetPlayer();
|
||||
}
|
||||
|
||||
uint32 notspeaktime = (uint32) atoi(delayStr);
|
||||
|
||||
@@ -109,10 +107,8 @@ bool ChatHandler::HandleUnmuteCommand(const char* args)
|
||||
|
||||
// find only player from same account if any
|
||||
if(!target)
|
||||
{
|
||||
if(WorldSession* session = sWorld.FindSession(account_id))
|
||||
target = session->GetPlayer();
|
||||
}
|
||||
|
||||
// must have strong lesser security level
|
||||
if(HasLowerSecurity (target,target_guid,true))
|
||||
@@ -345,10 +341,8 @@ bool ChatHandler::HandleGoCreatureCommand(const char* args)
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
if( result->GetRowCount() > 1 )
|
||||
{
|
||||
if (result->GetRowCount() > 1)
|
||||
SendSysMessage(LANG_COMMAND_GOCREATMULTIPLE);
|
||||
}
|
||||
|
||||
Field *fields = result->Fetch();
|
||||
float x = fields[0].GetFloat();
|
||||
@@ -1966,7 +1960,6 @@ bool ChatHandler::HandleDeMorphCommand(const char* /*args*/)
|
||||
if(!target)
|
||||
target = m_session->GetPlayer();
|
||||
|
||||
|
||||
// check online security
|
||||
else if (target->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)target, 0))
|
||||
return false;
|
||||
@@ -2074,7 +2067,7 @@ bool ChatHandler::HandleKickPlayerCommand(const char *args)
|
||||
}
|
||||
|
||||
std::string nameLink = playerLink(name);
|
||||
|
||||
|
||||
if(sWorld.KickPlayer(name))
|
||||
{
|
||||
if(sWorld.getConfig(CONFIG_SHOW_KICK_IN_WORLD) == 1)
|
||||
@@ -2463,7 +2456,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
|
||||
char* arg_id = strtok(NULL, " ");
|
||||
uint32 id = 0;
|
||||
|
||||
|
||||
if(show == "add")
|
||||
{
|
||||
if(arg_id)
|
||||
@@ -2581,7 +2574,7 @@ bool ChatHandler::HandleWpEventCommand(const char* args)
|
||||
SendSysMessage("|cffff33ffERROR: No argument present.|r");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::string arg_string = arg_2;
|
||||
|
||||
if( (arg_string != "setid") && (arg_string != "delay") && (arg_string != "command")
|
||||
@@ -2850,7 +2843,6 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
return true;
|
||||
} // move
|
||||
|
||||
|
||||
const char *text = arg_str;
|
||||
|
||||
if( text == 0 )
|
||||
@@ -2872,7 +2864,6 @@ bool ChatHandler::HandleWpModifyCommand(const char* args)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ChatHandler::HandleWpShowCommand(const char* args)
|
||||
{
|
||||
sLog.outDebug("DEBUG: HandleWpShowCommand");
|
||||
@@ -3291,7 +3282,7 @@ bool ChatHandler::HandleCharacterReputationCommand(const char* args)
|
||||
LocaleConstant loc = GetSessionDbcLocale();
|
||||
|
||||
FactionStateList const& targetFSL = target->GetReputationMgr().GetStateList();
|
||||
for(FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
|
||||
for (FactionStateList::const_iterator itr = targetFSL.begin(); itr != targetFSL.end(); ++itr)
|
||||
{
|
||||
FactionEntry const *factionEntry = sFactionStore.LookupEntry(itr->second.ID);
|
||||
char const* factionName = factionEntry ? factionEntry->name[loc] : "#Not found#";
|
||||
@@ -3412,7 +3403,7 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
|
||||
GameEventMgr::GameEventDataMap const& events = gameeventmgr.GetEventMap();
|
||||
GameEventMgr::ActiveEvents const& activeEvents = gameeventmgr.GetActiveEventList();
|
||||
|
||||
for(uint32 id = 0; id < events.size(); ++id )
|
||||
for (uint32 id = 0; id < events.size(); ++id )
|
||||
{
|
||||
GameEventData const& eventData = events[id];
|
||||
|
||||
@@ -3449,7 +3440,7 @@ bool ChatHandler::HandleEventActiveListCommand(const char* args)
|
||||
|
||||
char const* active = GetTrinityString(LANG_ACTIVE);
|
||||
|
||||
for(GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
|
||||
for (GameEventMgr::ActiveEvents::const_iterator itr = activeEvents.begin(); itr != activeEvents.end(); ++itr )
|
||||
{
|
||||
uint32 event_id = *itr;
|
||||
GameEventData const& eventData = events[event_id];
|
||||
@@ -3650,7 +3641,7 @@ void ChatHandler::HandleLearnSkillRecipesHelper(Player* player,uint32 skill_id)
|
||||
}
|
||||
|
||||
bool ChatHandler::HandleLearnAllCraftsCommand(const char* /*args*/)
|
||||
{
|
||||
{
|
||||
|
||||
for (uint32 i = 0; i < sSkillLineStore.GetNumRows(); ++i)
|
||||
{
|
||||
@@ -3693,7 +3684,6 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
||||
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower( wnamepart );
|
||||
|
||||
|
||||
std::string name;
|
||||
|
||||
@@ -3717,7 +3707,7 @@ bool ChatHandler::HandleLearnAllRecipesCommand(const char* args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3946,7 +3936,7 @@ bool ChatHandler::HandleCreatePetCommand(const char* args)
|
||||
|
||||
if(!pet)
|
||||
return false;
|
||||
|
||||
|
||||
if(!pet->CreateBaseAtCreature(creatureTarget))
|
||||
{
|
||||
delete pet;
|
||||
@@ -4151,7 +4141,7 @@ bool ChatHandler::HandleTempGameObjectCommand(const char* args)
|
||||
|
||||
if( spawntime )
|
||||
spawntm = atoi((char*)spawntime);
|
||||
|
||||
|
||||
float x = chr->GetPositionX();
|
||||
float y = chr->GetPositionY();
|
||||
float z = chr->GetPositionZ();
|
||||
|
||||
+29
-29
@@ -2418,7 +2418,7 @@ bool ChatHandler::HandleLearnAllMyTalentsCommand(const char* /*args*/)
|
||||
|
||||
// search highest talent rank
|
||||
uint32 spellId = 0;
|
||||
for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
{
|
||||
if(talentInfo->RankID[rank] != 0)
|
||||
{
|
||||
@@ -2494,7 +2494,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/)
|
||||
// search highest talent rank
|
||||
uint32 spellid = 0;
|
||||
|
||||
for(int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
for (int8 rank = MAX_TALENT_RANK-1; rank >= 0; --rank)
|
||||
{
|
||||
if(talentInfo->RankID[rank]!=0)
|
||||
{
|
||||
@@ -2521,7 +2521,7 @@ bool ChatHandler::HandleLearnAllMyPetTalentsCommand(const char* /*args*/)
|
||||
bool ChatHandler::HandleLearnAllLangCommand(const char* /*args*/)
|
||||
{
|
||||
// skipping UNIVERSAL language (0)
|
||||
for(uint8 i = 1; i < LANGUAGES_COUNT; ++i)
|
||||
for (uint8 i = 1; i < LANGUAGES_COUNT; ++i)
|
||||
m_session->GetPlayer()->learnSpell(lang_description[i].spell_id,false);
|
||||
|
||||
SendSysMessage(LANG_COMMAND_LEARN_ALL_LANG);
|
||||
@@ -2679,7 +2679,7 @@ bool ChatHandler::HandleAddItemCommand(const char* args)
|
||||
|
||||
// remove binding (let GM give it to another player later)
|
||||
if(pl==plTarget)
|
||||
for(ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
|
||||
for (ItemPosCountVec::const_iterator itr = dest.begin(); itr != dest.end(); ++itr)
|
||||
if(Item* item1 = pl->GetItemByPos(itr->pos))
|
||||
item1->SetBinding( false );
|
||||
|
||||
@@ -3303,7 +3303,7 @@ bool ChatHandler::HandleLookupItemSetCommand(const char* args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3368,7 +3368,7 @@ bool ChatHandler::HandleLookupSkillCommand(const char* args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3447,7 +3447,7 @@ bool ChatHandler::HandleLookupSpellCommand(const char* args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3662,7 +3662,7 @@ bool ChatHandler::HandleLookupCreatureCommand(const char* args)
|
||||
|
||||
if(!found)
|
||||
found = true;
|
||||
|
||||
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@@ -3729,7 +3729,7 @@ bool ChatHandler::HandleLookupObjectCommand(const char* args)
|
||||
PSendSysMessage(LANG_GO_ENTRY_LIST_CHAT, id, id, name.c_str());
|
||||
else
|
||||
PSendSysMessage(LANG_GO_ENTRY_LIST_CONSOLE, id, name.c_str());
|
||||
|
||||
|
||||
if(!found)
|
||||
found = true;
|
||||
|
||||
@@ -3795,7 +3795,7 @@ bool ChatHandler::HandleLookupFactionCommand(const char* args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3885,7 +3885,7 @@ bool ChatHandler::HandleLookupTaxiNodeCommand(const char * args)
|
||||
if (!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = 0;
|
||||
for(; loc < MAX_LOCALE; ++loc)
|
||||
for (; loc < MAX_LOCALE; ++loc)
|
||||
{
|
||||
if(loc==GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -3936,7 +3936,7 @@ bool ChatHandler::HandleLookupMapCommand(const char* args)
|
||||
bool found = false;
|
||||
|
||||
// search in Map.dbc
|
||||
for(uint32 id = 0; id < sMapStore.GetNumRows(); id++)
|
||||
for (uint32 id = 0; id < sMapStore.GetNumRows(); id++)
|
||||
{
|
||||
MapEntry const* MapInfo = sMapStore.LookupEntry(id);
|
||||
if(MapInfo)
|
||||
@@ -3950,7 +3950,7 @@ bool ChatHandler::HandleLookupMapCommand(const char* args)
|
||||
if(!Utf8FitTo(name, wnamepart))
|
||||
{
|
||||
loc = LOCALE_enUS;
|
||||
for(; loc < MAX_LOCALE; loc++)
|
||||
for (; loc < MAX_LOCALE; loc++)
|
||||
{
|
||||
if(m_session && loc == m_session->GetSessionDbcLocale())
|
||||
continue;
|
||||
@@ -4370,7 +4370,7 @@ bool ChatHandler::HandleAuraCommand(const char* args)
|
||||
uint8 eff_mask=0;
|
||||
if(spellInfo)
|
||||
{
|
||||
for(uint32 i = 0;i<3;++i)
|
||||
for (uint32 i = 0; i<3; ++i)
|
||||
{
|
||||
uint8 eff = spellInfo->Effect[i];
|
||||
if (eff>=TOTAL_SPELL_EFFECTS)
|
||||
@@ -5381,7 +5381,7 @@ bool ChatHandler::HandleResetAllCommand(const char * args)
|
||||
|
||||
CharacterDatabase.PExecute("UPDATE characters SET at_login = at_login | '%u' WHERE (at_login & '%u') = '0'",atLogin,atLogin);
|
||||
HashMapHolder<Player>::MapType const& plist = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = plist.begin(); itr != plist.end(); ++itr)
|
||||
itr->second->SetAtLoginFlag(atLogin);
|
||||
|
||||
return true;
|
||||
@@ -5615,7 +5615,7 @@ bool ChatHandler::HandleQuestRemove(const char* args)
|
||||
}
|
||||
|
||||
// remove all quest entries for 'entry' from quest log
|
||||
for(uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot )
|
||||
for (uint8 slot = 0; slot < MAX_QUEST_LOG_SIZE; ++slot )
|
||||
{
|
||||
uint32 quest = player->GetQuestSlotQuestId(slot);
|
||||
if(quest==entry)
|
||||
@@ -5666,7 +5666,7 @@ bool ChatHandler::HandleQuestComplete(const char* args)
|
||||
}
|
||||
|
||||
// Add quest items for quests that require items
|
||||
for(uint8 x = 0; x < QUEST_OBJECTIVES_COUNT; ++x)
|
||||
for (uint8 x = 0; x < QUEST_OBJECTIVES_COUNT; ++x)
|
||||
{
|
||||
uint32 id = pQuest->ReqItemId[x];
|
||||
uint32 count = pQuest->ReqItemCount[x];
|
||||
@@ -5685,25 +5685,25 @@ bool ChatHandler::HandleQuestComplete(const char* args)
|
||||
}
|
||||
|
||||
// All creature/GO slain/casted (not required, but otherwise it will display "Creature slain 0/10")
|
||||
for(uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
for (uint8 i = 0; i < QUEST_OBJECTIVES_COUNT; ++i)
|
||||
{
|
||||
uint32 creature = pQuest->ReqCreatureOrGOId[i];
|
||||
uint32 creaturecount = pQuest->ReqCreatureOrGOCount[i];
|
||||
|
||||
if(uint32 spell_id = pQuest->ReqSpell[i])
|
||||
{
|
||||
for(uint16 z = 0; z < creaturecount; ++z)
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->CastedCreatureOrGO(creature,0,spell_id);
|
||||
}
|
||||
else if(creature > 0)
|
||||
{
|
||||
if(CreatureInfo const* cInfo = objmgr.GetCreatureTemplate(creature))
|
||||
for(uint16 z = 0; z < creaturecount; ++z)
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->KilledMonster(cInfo,0);
|
||||
}
|
||||
else if(creature < 0)
|
||||
{
|
||||
for(uint16 z = 0; z < creaturecount; ++z)
|
||||
for (uint16 z = 0; z < creaturecount; ++z)
|
||||
player->CastedCreatureOrGO(creature,0,0);
|
||||
}
|
||||
}
|
||||
@@ -6419,7 +6419,7 @@ bool ChatHandler::HandleMovegensCommand(const char* /*args*/)
|
||||
PSendSysMessage(LANG_MOVEGENS_LIST,(unit->GetTypeId()==TYPEID_PLAYER ? "Player" : "Creature" ),unit->GetGUIDLow());
|
||||
|
||||
MotionMaster* mm = unit->GetMotionMaster();
|
||||
for(uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
{
|
||||
MovementGenerator* mg = mm->GetMotionSlot(i);
|
||||
if(!mg)
|
||||
@@ -6791,10 +6791,10 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
||||
Player* player = getSelectedPlayer();
|
||||
if (!player) player = m_session->GetPlayer();
|
||||
uint32 counter = 0;
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
Player::BoundInstancesMap &binds = player->GetBoundInstances(i);
|
||||
for(Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
for (Player::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
{
|
||||
InstanceSave *save = itr->second.save;
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||
@@ -6807,10 +6807,10 @@ bool ChatHandler::HandleInstanceListBindsCommand(const char* /*args*/)
|
||||
Group *group = player->GetGroup();
|
||||
if(group)
|
||||
{
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
Group::BoundInstancesMap &binds = group->GetBoundInstances(i);
|
||||
for(Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
for (Group::BoundInstancesMap::const_iterator itr = binds.begin(); itr != binds.end(); ++itr)
|
||||
{
|
||||
InstanceSave *save = itr->second.save;
|
||||
std::string timeleft = GetTimeString(save->GetResetTime() - time(NULL));
|
||||
@@ -6835,10 +6835,10 @@ bool ChatHandler::HandleInstanceUnbindCommand(const char* args)
|
||||
Player* player = getSelectedPlayer();
|
||||
if (!player) player = m_session->GetPlayer();
|
||||
uint32 counter = 0;
|
||||
for(uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
for (uint8 i = 0; i < TOTAL_DIFFICULTIES; ++i)
|
||||
{
|
||||
Player::BoundInstancesMap &binds = player->GetBoundInstances(i);
|
||||
for(Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end();)
|
||||
for (Player::BoundInstancesMap::iterator itr = binds.begin(); itr != binds.end(); )
|
||||
{
|
||||
if(itr->first != player->GetMapId())
|
||||
{
|
||||
@@ -7102,7 +7102,7 @@ bool ChatHandler::HandleSendItemsCommand(const char* args)
|
||||
// fill mail
|
||||
MailItemsInfo mi; // item list preparing
|
||||
|
||||
for(ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
|
||||
for (ItemPairs::const_iterator itr = items.begin(); itr != items.end(); ++itr)
|
||||
{
|
||||
if(Item* item = Item::CreateItem(itr->first,itr->second,m_session ? m_session->GetPlayer() : 0))
|
||||
{
|
||||
|
||||
@@ -217,7 +217,7 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
|
||||
Group *group = player->GetGroup();
|
||||
|
||||
std::vector<Player*> playersNear;
|
||||
for(GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* playerGroup = itr->getSource();
|
||||
if(!playerGroup)
|
||||
@@ -511,7 +511,6 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
|
||||
item.count=0;
|
||||
item.is_looted=true;
|
||||
|
||||
|
||||
pLoot->NotifyItemRemoved(slotid);
|
||||
--pLoot->unlootedCount;
|
||||
}
|
||||
|
||||
+30
-32
@@ -50,7 +50,6 @@ LootStore LootTemplates_Reference( "reference_loot_template", "reference i
|
||||
LootStore LootTemplates_Skinning( "skinning_loot_template", "creature skinning id", true);
|
||||
LootStore LootTemplates_Spell( "spell_loot_template", "spell id (random item creating)",false);
|
||||
|
||||
|
||||
class LootTemplate::LootGroup // A set of loot definitions for items (refs are not allowed)
|
||||
{
|
||||
public:
|
||||
@@ -128,7 +127,6 @@ void LootStore::LoadLootTable()
|
||||
continue; // error already printed to log/console.
|
||||
}
|
||||
|
||||
|
||||
if(!PlayerCondition::IsValid(condition,cond_value1, cond_value2))
|
||||
{
|
||||
sLog.outErrorDb("... in table '%s' entry %u item %u", GetName(), entry, item);
|
||||
@@ -212,20 +210,20 @@ void LootStore::LoadAndCollectLootIds(LootIdSet& ids_set)
|
||||
{
|
||||
LoadLootTable();
|
||||
|
||||
for(LootTemplateMap::const_iterator tab = m_LootTemplates.begin(); tab != m_LootTemplates.end(); ++tab)
|
||||
for (LootTemplateMap::const_iterator tab = m_LootTemplates.begin(); tab != m_LootTemplates.end(); ++tab)
|
||||
ids_set.insert(tab->first);
|
||||
}
|
||||
|
||||
void LootStore::CheckLootRefs(LootIdSet* ref_set) const
|
||||
{
|
||||
for(LootTemplateMap::const_iterator ltItr = m_LootTemplates.begin(); ltItr != m_LootTemplates.end(); ++ltItr)
|
||||
for (LootTemplateMap::const_iterator ltItr = m_LootTemplates.begin(); ltItr != m_LootTemplates.end(); ++ltItr)
|
||||
ltItr->second->CheckLootRefs(m_LootTemplates,ref_set);
|
||||
}
|
||||
|
||||
void LootStore::ReportUnusedIds(LootIdSet const& ids_set) const
|
||||
{
|
||||
// all still listed ids isn't referenced
|
||||
for(LootIdSet::const_iterator itr = ids_set.begin(); itr != ids_set.end(); ++itr)
|
||||
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());
|
||||
}
|
||||
|
||||
@@ -412,7 +410,7 @@ void Loot::FillLoot(uint32 loot_id, LootStore const& store, Player* loot_owner,
|
||||
Group * pGroup=loot_owner->GetGroup();
|
||||
if(!personal && pGroup)
|
||||
{
|
||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
if(Player* pl = itr->getSource())
|
||||
FillNotNormalLootFor(pl);
|
||||
}
|
||||
@@ -442,7 +440,7 @@ QuestItemList* Loot::FillFFALoot(Player* player)
|
||||
{
|
||||
QuestItemList *ql = new QuestItemList();
|
||||
|
||||
for(uint8 i = 0; i < items.size(); ++i)
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
LootItem &item = items[i];
|
||||
if(!item.is_looted && item.freeforall && item.AllowedForPlayer(player) )
|
||||
@@ -466,7 +464,7 @@ QuestItemList* Loot::FillQuestLoot(Player* player)
|
||||
if (items.size() == MAX_NR_LOOT_ITEMS) return NULL;
|
||||
QuestItemList *ql = new QuestItemList();
|
||||
|
||||
for(uint8 i = 0; i < quest_items.size(); ++i)
|
||||
for (uint8 i = 0; i < quest_items.size(); ++i)
|
||||
{
|
||||
LootItem &item = quest_items[i];
|
||||
if(!item.is_looted && item.AllowedForPlayer(player) )
|
||||
@@ -500,7 +498,7 @@ QuestItemList* Loot::FillNonQuestNonFFAConditionalLoot(Player* player)
|
||||
{
|
||||
QuestItemList *ql = new QuestItemList();
|
||||
|
||||
for(uint8 i = 0; i < items.size(); ++i)
|
||||
for (uint8 i = 0; i < items.size(); ++i)
|
||||
{
|
||||
LootItem &item = items[i];
|
||||
if(!item.is_looted && !item.freeforall && item.conditionId && item.AllowedForPlayer(player))
|
||||
@@ -530,7 +528,7 @@ void Loot::NotifyItemRemoved(uint8 lootIndex)
|
||||
// notify all players that are looting this that the item was removed
|
||||
// convert the index to the slot the player sees
|
||||
std::set<uint64>::iterator i_next;
|
||||
for(std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
for (std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
{
|
||||
i_next = i;
|
||||
++i_next;
|
||||
@@ -545,7 +543,7 @@ void Loot::NotifyMoneyRemoved()
|
||||
{
|
||||
// notify all players that are looting this that the money was removed
|
||||
std::set<uint64>::iterator i_next;
|
||||
for(std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
for (std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
{
|
||||
i_next = i;
|
||||
++i_next;
|
||||
@@ -564,7 +562,7 @@ void Loot::NotifyQuestItemRemoved(uint8 questIndex)
|
||||
// bit inefficient but isn't called often
|
||||
|
||||
std::set<uint64>::iterator i_next;
|
||||
for(std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
for (std::set<uint64>::iterator i = PlayersLooting.begin(); i != PlayersLooting.end(); i = i_next)
|
||||
{
|
||||
i_next = i;
|
||||
++i_next;
|
||||
@@ -629,7 +627,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem **qite
|
||||
QuestItemMap::const_iterator itr = PlayerFFAItems.find(player->GetGUIDLow());
|
||||
if (itr != PlayerFFAItems.end())
|
||||
{
|
||||
for(QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
if(iter->index==lootSlot)
|
||||
{
|
||||
QuestItem *ffaitem2 = (QuestItem*)&(*iter);
|
||||
@@ -645,7 +643,7 @@ LootItem* Loot::LootItemInSlot(uint32 lootSlot, Player* player, QuestItem **qite
|
||||
QuestItemMap::const_iterator itr = PlayerNonQuestNonFFAConditionalItems.find(player->GetGUIDLow());
|
||||
if (itr != PlayerNonQuestNonFFAConditionalItems.end())
|
||||
{
|
||||
for(QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
for (QuestItemList::const_iterator iter=itr->second->begin(); iter!= itr->second->end(); ++iter)
|
||||
{
|
||||
if(iter->index==lootSlot)
|
||||
{
|
||||
@@ -1059,7 +1057,7 @@ void LootTemplate::Verify(LootStore const& lootstore, uint32 id) const
|
||||
|
||||
void LootTemplate::CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_set) const
|
||||
{
|
||||
for(LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
|
||||
for (LootStoreItemList::const_iterator ieItr = Entries.begin(); ieItr != Entries.end(); ++ieItr)
|
||||
{
|
||||
if(ieItr->mincountOrRef < 0)
|
||||
{
|
||||
@@ -1070,7 +1068,7 @@ void LootTemplate::CheckLootRefs(LootTemplateMap const& store, LootIdSet* ref_se
|
||||
}
|
||||
}
|
||||
|
||||
for(LootGroups::const_iterator grItr = Groups.begin(); grItr != Groups.end(); ++grItr)
|
||||
for (LootGroups::const_iterator grItr = Groups.begin(); grItr != Groups.end(); ++grItr)
|
||||
grItr->CheckLootRefs(store,ref_set);
|
||||
}
|
||||
|
||||
@@ -1080,7 +1078,7 @@ void LoadLootTemplates_Creature()
|
||||
LootTemplates_Creature.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
{
|
||||
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
||||
{
|
||||
@@ -1093,7 +1091,7 @@ void LoadLootTemplates_Creature()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
ids_set.erase(*itr);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
@@ -1106,7 +1104,7 @@ void LoadLootTemplates_Disenchant()
|
||||
LootTemplates_Disenchant.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
{
|
||||
if(ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
|
||||
{
|
||||
@@ -1119,7 +1117,7 @@ void LoadLootTemplates_Disenchant()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
ids_set.erase(*itr);
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
LootTemplates_Disenchant.ReportUnusedIds(ids_set);
|
||||
@@ -1131,7 +1129,7 @@ void LoadLootTemplates_Fishing()
|
||||
LootTemplates_Fishing.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sAreaStore.GetNumRows(); ++i )
|
||||
for (uint32 i = 1; i < sAreaStore.GetNumRows(); ++i )
|
||||
{
|
||||
if(AreaTableEntry const* areaEntry = sAreaStore.LookupEntry(i))
|
||||
if(ids_set.count(areaEntry->ID))
|
||||
@@ -1148,7 +1146,7 @@ void LoadLootTemplates_Gameobject()
|
||||
LootTemplates_Gameobject.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sGOStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i )
|
||||
{
|
||||
if(GameObjectInfo const* gInfo = sGOStorage.LookupEntry<GameObjectInfo>(i))
|
||||
{
|
||||
@@ -1161,7 +1159,7 @@ void LoadLootTemplates_Gameobject()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
ids_set.erase(*itr);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
@@ -1174,7 +1172,7 @@ void LoadLootTemplates_Item()
|
||||
LootTemplates_Item.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
if(ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i))
|
||||
if(ids_set.count(proto->ItemId))
|
||||
ids_set.erase(proto->ItemId);
|
||||
@@ -1189,7 +1187,7 @@ void LoadLootTemplates_Milling()
|
||||
LootTemplates_Milling.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
{
|
||||
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
|
||||
if(!proto)
|
||||
@@ -1212,7 +1210,7 @@ void LoadLootTemplates_Pickpocketing()
|
||||
LootTemplates_Pickpocketing.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
{
|
||||
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
||||
{
|
||||
@@ -1225,7 +1223,7 @@ void LoadLootTemplates_Pickpocketing()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
ids_set.erase(*itr);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
@@ -1238,7 +1236,7 @@ void LoadLootTemplates_Prospecting()
|
||||
LootTemplates_Prospecting.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i )
|
||||
{
|
||||
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype>(i);
|
||||
if(!proto)
|
||||
@@ -1262,7 +1260,7 @@ void LoadLootTemplates_QuestMail()
|
||||
|
||||
// remove real entries and check existence loot
|
||||
ObjectMgr::QuestMap const& questMap = objmgr.GetQuestTemplates();
|
||||
for(ObjectMgr::QuestMap::const_iterator itr = questMap.begin(); itr != questMap.end(); ++itr )
|
||||
for (ObjectMgr::QuestMap::const_iterator itr = questMap.begin(); itr != questMap.end(); ++itr )
|
||||
{
|
||||
if(!itr->second->GetRewMailTemplateId())
|
||||
continue;
|
||||
@@ -1285,7 +1283,7 @@ void LoadLootTemplates_Skinning()
|
||||
LootTemplates_Skinning.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i )
|
||||
{
|
||||
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
||||
{
|
||||
@@ -1298,7 +1296,7 @@ void LoadLootTemplates_Skinning()
|
||||
}
|
||||
}
|
||||
}
|
||||
for(LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
for (LootIdSet::const_iterator itr = ids_setUsed.begin(); itr != ids_setUsed.end(); ++itr)
|
||||
ids_set.erase(*itr);
|
||||
|
||||
// output error for any still listed (not referenced from appropriate table) ids
|
||||
@@ -1311,7 +1309,7 @@ void LoadLootTemplates_Spell()
|
||||
LootTemplates_Spell.LoadAndCollectLootIds(ids_set);
|
||||
|
||||
// remove real entries and check existence loot
|
||||
for(uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id)
|
||||
for (uint32 spell_id = 1; spell_id < sSpellStore.GetNumRows(); ++spell_id)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry (spell_id);
|
||||
if(!spellInfo)
|
||||
|
||||
+11
-11
@@ -85,7 +85,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
|
||||
if(items_count)
|
||||
{
|
||||
for(uint8 i = 0; i < items_count; ++i)
|
||||
for (uint8 i = 0; i < items_count; ++i)
|
||||
{
|
||||
uint8 item_slot;
|
||||
uint64 item_guid;
|
||||
@@ -178,7 +178,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
|
||||
if (items_count)
|
||||
{
|
||||
for(MailItemMap::iterator mailItemIter = mi.begin(); mailItemIter != mi.end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = mi.begin(); mailItemIter != mi.end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
|
||||
@@ -238,7 +238,7 @@ void WorldSession::HandleSendMail(WorldPacket & recv_data )
|
||||
{
|
||||
if (items_count > 0)
|
||||
{
|
||||
for(MailItemMap::iterator mailItemIter = mi.begin(); mailItemIter != mi.end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = mi.begin(); mailItemIter != mi.end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
if(!mailItem.item)
|
||||
@@ -365,7 +365,7 @@ void WorldSession::HandleMailReturnToSender(WorldPacket & recv_data )
|
||||
|
||||
if(m->HasItems())
|
||||
{
|
||||
for(std::vector<MailItemInfo>::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
|
||||
for (std::vector<MailItemInfo>::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
|
||||
{
|
||||
Item *item = pl->GetMItem(itr2->item_guid);
|
||||
if(item)
|
||||
@@ -422,7 +422,7 @@ void WorldSession::SendReturnToSender(uint8 messageType, uint32 sender_acc, uint
|
||||
|
||||
// set owner to new receiver (to prevent delete item with sender char deleting)
|
||||
CharacterDatabase.BeginTransaction();
|
||||
for(MailItemMap::iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
mailItem.item->SaveToDB(); // item not in inventory and can be save standalone
|
||||
@@ -590,7 +590,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
data << uint8(0); // mail's count
|
||||
time_t cur_time = time(NULL);
|
||||
|
||||
for(PlayerMails::iterator itr = pl->GetmailBegin(); itr != pl->GetmailEnd(); ++itr)
|
||||
for (PlayerMails::iterator itr = pl->GetmailBegin(); itr != pl->GetmailEnd(); ++itr)
|
||||
{
|
||||
// skip deleted or not delivered (deliver delay not expired) mails
|
||||
if ((*itr)->state == MAIL_STATE_DELETED || cur_time < (*itr)->deliver_time)
|
||||
@@ -642,7 +642,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
|
||||
data << (uint8) item_count; // client limit is 0x10
|
||||
|
||||
for(uint8 i = 0; i < item_count; ++i)
|
||||
for (uint8 i = 0; i < item_count; ++i)
|
||||
{
|
||||
Item *item = pl->GetMItem((*itr)->items[i].item_guid);
|
||||
// item index (0-6?)
|
||||
@@ -651,7 +651,7 @@ void WorldSession::HandleGetMailList(WorldPacket & recv_data )
|
||||
data << (uint32) (item ? item->GetGUIDLow() : 0);
|
||||
// entry
|
||||
data << (uint32) (item ? item->GetEntry() : 0);
|
||||
for(uint8 j = 0; j < MAX_INSPECTED_ENCHANTMENT_SLOT; ++j)
|
||||
for (uint8 j = 0; j < MAX_INSPECTED_ENCHANTMENT_SLOT; ++j)
|
||||
{
|
||||
// unsure
|
||||
data << (uint32) (item ? item->GetEnchantmentCharges((EnchantmentSlot)j) : 0);
|
||||
@@ -771,7 +771,7 @@ void WorldSession::HandleQueryNextMailTime(WorldPacket & /*recv_data*/ )
|
||||
|
||||
uint32 count = 0;
|
||||
time_t now = time(NULL);
|
||||
for(PlayerMails::iterator itr = _player->GetmailBegin(); itr != _player->GetmailEnd(); ++itr)
|
||||
for (PlayerMails::iterator itr = _player->GetmailBegin(); itr != _player->GetmailEnd(); ++itr)
|
||||
{
|
||||
Mail *m = (*itr);
|
||||
// must be not checked yet
|
||||
@@ -872,7 +872,7 @@ void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 station
|
||||
|
||||
if(mi)
|
||||
{
|
||||
for(MailItemMap::iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
if(mailItem.item)
|
||||
@@ -894,7 +894,7 @@ void WorldSession::SendMailTo(Player* receiver, uint8 messageType, uint8 station
|
||||
|
||||
if(mi)
|
||||
{
|
||||
for(MailItemMap::const_iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
for (MailItemMap::const_iterator mailItemIter = mi->begin(); mailItemIter != mi->end(); ++mailItemIter)
|
||||
{
|
||||
MailItem const& mailItem = mailItemIter->second;
|
||||
CharacterDatabase.PExecute("INSERT INTO mail_items (mail_id,item_guid,item_template,receiver) VALUES ('%u', '%u', '%u','%u')", mailId, mailItem.item_guidlow, mailItem.item_template,receiver_guidlow);
|
||||
|
||||
+3
-3
@@ -126,7 +126,7 @@ class MailItemsInfo
|
||||
|
||||
void deleteIncludedItems(bool inDB = false)
|
||||
{
|
||||
for(MailItemMap::iterator mailItemIter = begin(); mailItemIter != end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = begin(); mailItemIter != end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
mailItem.deleteItem(inDB);
|
||||
@@ -165,7 +165,7 @@ struct Mail
|
||||
|
||||
void AddAllItems(MailItemsInfo& pMailItemsInfo)
|
||||
{
|
||||
for(MailItemMap::iterator mailItemIter = pMailItemsInfo.begin(); mailItemIter != pMailItemsInfo.end(); ++mailItemIter)
|
||||
for (MailItemMap::iterator mailItemIter = pMailItemsInfo.begin(); mailItemIter != pMailItemsInfo.end(); ++mailItemIter)
|
||||
{
|
||||
MailItem& mailItem = mailItemIter->second;
|
||||
AddItem(mailItem.item_guidlow, mailItem.item_template);
|
||||
@@ -174,7 +174,7 @@ struct Mail
|
||||
|
||||
bool RemoveItem(uint32 item_guid)
|
||||
{
|
||||
for(std::vector<MailItemInfo>::iterator itr = items.begin(); itr != items.end(); ++itr)
|
||||
for (std::vector<MailItemInfo>::iterator itr = items.begin(); itr != items.end(); ++itr)
|
||||
{
|
||||
if(itr->item_guid == item_guid)
|
||||
{
|
||||
|
||||
+56
-56
@@ -217,20 +217,20 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode, Map* _par
|
||||
{
|
||||
m_notifyTimer.SetInterval(IN_MILISECONDS/2);
|
||||
|
||||
for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
|
||||
for (unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
|
||||
{
|
||||
for(unsigned int j=0; j < MAX_NUMBER_OF_GRIDS; ++j)
|
||||
for (unsigned int j=0; j < MAX_NUMBER_OF_GRIDS; ++j)
|
||||
{
|
||||
//z code
|
||||
GridMaps[idx][j] =NULL;
|
||||
setNGrid(NULL, idx, j);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//lets initialize visibility distance for map
|
||||
Map::InitVisibilityDistance();
|
||||
}
|
||||
|
||||
|
||||
void Map::InitVisibilityDistance()
|
||||
{
|
||||
//init visibility for continents
|
||||
@@ -501,43 +501,43 @@ Map::Add(T *obj)
|
||||
void Map::MessageBroadcast(Player *player, WorldPacket *msg, bool to_self)
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
|
||||
|
||||
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::MessageBroadcast: Player (GUID: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), p.x_coord, p.y_coord);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
||||
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
|
||||
return;
|
||||
|
||||
|
||||
MaNGOS::MessageDeliverer post_man(*player, msg, to_self);
|
||||
TypeContainerVisitor<MaNGOS::MessageDeliverer, WorldTypeMapContainer > message(post_man);
|
||||
CellLock<ReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, message, *this, *player, GetVisibilityDistance());
|
||||
}
|
||||
|
||||
|
||||
void Map::MessageBroadcast(WorldObject *obj, WorldPacket *msg)
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
|
||||
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::MessageBroadcast: Object (GUID: %u TypeId: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
||||
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
|
||||
return;
|
||||
|
||||
|
||||
//TODO: currently on continents when Visibility.Distance.InFlight > Visibility.Distance.Continents
|
||||
//we have alot of blinking mobs because monster move packet send is broken...
|
||||
MaNGOS::ObjectMessageDeliverer post_man(*obj,msg);
|
||||
@@ -549,43 +549,43 @@ void Map::MessageBroadcast(WorldObject *obj, WorldPacket *msg)
|
||||
void Map::MessageDistBroadcast(Player *player, WorldPacket *msg, float dist, bool to_self, bool own_team_only)
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(player->GetPositionX(), player->GetPositionY());
|
||||
|
||||
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::MessageBroadcast: Player (GUID: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", player->GetGUIDLow(), player->GetPositionX(), player->GetPositionY(), p.x_coord, p.y_coord);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
||||
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
|
||||
return;
|
||||
|
||||
|
||||
MaNGOS::MessageDistDeliverer post_man(*player, msg, dist, to_self, own_team_only);
|
||||
TypeContainerVisitor<MaNGOS::MessageDistDeliverer , WorldTypeMapContainer > message(post_man);
|
||||
CellLock<ReadGuard> cell_lock(cell, p);
|
||||
cell_lock->Visit(cell_lock, message, *this, *player, dist);
|
||||
}
|
||||
|
||||
|
||||
void Map::MessageDistBroadcast(WorldObject *obj, WorldPacket *msg, float dist)
|
||||
{
|
||||
CellPair p = MaNGOS::ComputeCellPair(obj->GetPositionX(), obj->GetPositionY());
|
||||
|
||||
|
||||
if(p.x_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP || p.y_coord >= TOTAL_NUMBER_OF_CELLS_PER_MAP )
|
||||
{
|
||||
sLog.outError("Map::MessageBroadcast: Object (GUID: %u TypeId: %u) have invalid coordinates X:%f Y:%f grid cell [%u:%u]", obj->GetGUIDLow(), obj->GetTypeId(), obj->GetPositionX(), obj->GetPositionY(), p.x_coord, p.y_coord);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Cell cell(p);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
|
||||
|
||||
if( !loaded(GridPair(cell.data.Part.grid_x, cell.data.Part.grid_y)) )
|
||||
return;
|
||||
|
||||
|
||||
MaNGOS::ObjectMessageDistDeliverer post_man(*obj, msg, dist);
|
||||
TypeContainerVisitor<MaNGOS::ObjectMessageDistDeliverer, WorldTypeMapContainer > message(post_man);
|
||||
CellLock<ReadGuard> cell_lock(cell, p);
|
||||
@@ -603,7 +603,7 @@ void Map::RelocationNotify()
|
||||
i_notifyLock = true;
|
||||
|
||||
//Notify
|
||||
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||
for (std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||
{
|
||||
Unit *unit = *iter;
|
||||
if(!unit)
|
||||
@@ -639,7 +639,7 @@ void Map::RelocationNotify()
|
||||
VisitAll(unit->GetPositionX(), unit->GetPositionY(), GetVisibilityDistance() + dist, notifier);
|
||||
}
|
||||
}
|
||||
for(std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||
for (std::vector<Unit*>::iterator iter = i_unitsToNotify.begin(); iter != i_unitsToNotify.end(); ++iter)
|
||||
if(*iter)
|
||||
(*iter)->m_Notified = false;
|
||||
i_unitsToNotify.clear();
|
||||
@@ -697,7 +697,7 @@ void Map::RemoveUnitFromNotify(Unit *unit)
|
||||
void Map::Update(const uint32 &t_diff)
|
||||
{
|
||||
/// update players at tick
|
||||
for(m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* plr = m_mapRefIter->getSource();
|
||||
if(plr && plr->IsInWorld())
|
||||
@@ -722,7 +722,7 @@ void Map::Update(const uint32 &t_diff)
|
||||
|
||||
// the player iterator is stored in the map object
|
||||
// to make sure calls to Map::Remove don't invalidate it
|
||||
for(m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
for (m_mapRefIter = m_mapRefManager.begin(); m_mapRefIter != m_mapRefManager.end(); ++m_mapRefIter)
|
||||
{
|
||||
Player* plr = m_mapRefIter->getSource();
|
||||
|
||||
@@ -742,9 +742,9 @@ void Map::Update(const uint32 &t_diff)
|
||||
CellArea area = Cell::CalculateCellArea(*plr, GetVisibilityDistance());
|
||||
area.ResizeBorders(begin_cell, end_cell);
|
||||
|
||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
||||
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
{
|
||||
// marked cells are those that have been visited
|
||||
// don't visit the same cell twice
|
||||
@@ -770,7 +770,7 @@ void Map::Update(const uint32 &t_diff)
|
||||
// non-player active objects
|
||||
if(!m_activeNonPlayers.empty())
|
||||
{
|
||||
for(m_activeNonPlayersIter = m_activeNonPlayers.begin(); m_activeNonPlayersIter != m_activeNonPlayers.end(); )
|
||||
for (m_activeNonPlayersIter = m_activeNonPlayers.begin(); m_activeNonPlayersIter != m_activeNonPlayers.end(); )
|
||||
{
|
||||
// skip not in world
|
||||
WorldObject* obj = *m_activeNonPlayersIter;
|
||||
@@ -794,9 +794,9 @@ void Map::Update(const uint32 &t_diff)
|
||||
begin_cell << 1; begin_cell -= 1; // upper left
|
||||
end_cell >> 1; end_cell += 1; // lower right
|
||||
|
||||
for(uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
||||
for (uint32 x = begin_cell.x_coord; x <= end_cell.x_coord; ++x)
|
||||
{
|
||||
for(uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
for (uint32 y = begin_cell.y_coord; y <= end_cell.y_coord; ++y)
|
||||
{
|
||||
// marked cells are those that have been visited
|
||||
// don't visit the same cell twice
|
||||
@@ -974,7 +974,7 @@ Map::CreatureRelocation(Creature *creature, float x, float y, float z, float ang
|
||||
|
||||
if(creature->IsVehicle())
|
||||
{
|
||||
for(SeatMap::iterator itr = creature->GetVehicleKit()->m_Seats.begin(); itr != creature->GetVehicleKit()->m_Seats.end(); ++itr)
|
||||
for (SeatMap::iterator itr = creature->GetVehicleKit()->m_Seats.begin(); itr != creature->GetVehicleKit()->m_Seats.end(); ++itr)
|
||||
if(Unit *passenger = itr->second.passenger)
|
||||
{
|
||||
if(passenger->GetTypeId() == TYPEID_PLAYER)
|
||||
@@ -1204,7 +1204,7 @@ void Map::RemoveAllPlayers()
|
||||
{
|
||||
if(HavePlayers())
|
||||
{
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
{
|
||||
Player* plr = itr->getSource();
|
||||
if(!plr->IsBeingTeleportedFar())
|
||||
@@ -2118,10 +2118,10 @@ void Map::UpdateObjectVisibility( WorldObject* obj, Cell cell, CellPair cellpair
|
||||
void Map::UpdatePlayerVisibility( Player* player, Cell cell, CellPair cellpair )
|
||||
{
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
|
||||
|
||||
MaNGOS::PlayerNotifier pl_notifier(*player);
|
||||
TypeContainerVisitor<MaNGOS::PlayerNotifier, WorldTypeMapContainer > player_notifier(pl_notifier);
|
||||
|
||||
|
||||
CellLock<ReadGuard> cell_lock(cell, cellpair);
|
||||
cell_lock->Visit(cell_lock, player_notifier, *this, *player, GetVisibilityDistance());
|
||||
}
|
||||
@@ -2129,7 +2129,7 @@ void Map::UpdatePlayerVisibility( Player* player, Cell cell, CellPair cellpair )
|
||||
void Map::UpdateObjectsVisibilityFor( Player* player, Cell cell, CellPair cellpair )
|
||||
{
|
||||
MaNGOS::VisibleNotifier notifier(*player);
|
||||
|
||||
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate();
|
||||
TypeContainerVisitor<MaNGOS::VisibleNotifier, WorldTypeMapContainer > world_notifier(notifier);
|
||||
@@ -2137,34 +2137,34 @@ void Map::UpdateObjectsVisibilityFor( Player* player, Cell cell, CellPair cellpa
|
||||
CellLock<GridReadGuard> cell_lock(cell, cellpair);
|
||||
cell_lock->Visit(cell_lock, world_notifier, *this, *player, GetVisibilityDistance());
|
||||
cell_lock->Visit(cell_lock, grid_notifier, *this, *player, GetVisibilityDistance());
|
||||
|
||||
|
||||
// send data
|
||||
notifier.Notify();
|
||||
}
|
||||
|
||||
|
||||
void Map::PlayerRelocationNotify( Player* player, Cell cell, CellPair cellpair )
|
||||
{
|
||||
CellLock<ReadGuard> cell_lock(cell, cellpair);
|
||||
MaNGOS::PlayerRelocationNotifier relocationNotifier(*player);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
|
||||
|
||||
TypeContainerVisitor<MaNGOS::PlayerRelocationNotifier, GridTypeMapContainer > p2grid_relocation(relocationNotifier);
|
||||
TypeContainerVisitor<MaNGOS::PlayerRelocationNotifier, WorldTypeMapContainer > p2world_relocation(relocationNotifier);
|
||||
|
||||
|
||||
cell_lock->Visit(cell_lock, p2grid_relocation, *this, *player, MAX_CREATURE_ATTACK_RADIUS);
|
||||
cell_lock->Visit(cell_lock, p2world_relocation, *this, *player, MAX_CREATURE_ATTACK_RADIUS);
|
||||
}
|
||||
|
||||
|
||||
void Map::CreatureRelocationNotify(Creature *creature, Cell cell, CellPair cellpair)
|
||||
{
|
||||
CellLock<ReadGuard> cell_lock(cell, cellpair);
|
||||
MaNGOS::CreatureRelocationNotifier relocationNotifier(*creature);
|
||||
cell.data.Part.reserved = ALL_DISTRICT;
|
||||
cell.SetNoCreate(); // not trigger load unloaded grids at notifier call
|
||||
|
||||
|
||||
TypeContainerVisitor<MaNGOS::CreatureRelocationNotifier, WorldTypeMapContainer > c2world_relocation(relocationNotifier);
|
||||
TypeContainerVisitor<MaNGOS::CreatureRelocationNotifier, GridTypeMapContainer > c2grid_relocation(relocationNotifier);
|
||||
|
||||
|
||||
cell_lock->Visit(cell_lock, c2world_relocation, *this, *creature, MAX_CREATURE_ATTACK_RADIUS);
|
||||
cell_lock->Visit(cell_lock, c2grid_relocation, *this, *creature, MAX_CREATURE_ATTACK_RADIUS);
|
||||
}
|
||||
@@ -2188,7 +2188,7 @@ void Map::SendInitSelf( Player * player )
|
||||
// build other passengers at transport also (they always visible and marked as visible and will not send at visibility update at add to map
|
||||
if(Transport* transport = player->GetTransport())
|
||||
{
|
||||
for(Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin();itr!=transport->GetPassengers().end();++itr)
|
||||
for (Transport::PlayerSet::const_iterator itr = transport->GetPassengers().begin(); itr!=transport->GetPassengers().end(); ++itr)
|
||||
{
|
||||
if(player!=(*itr) && player->HaveAtClient(*itr))
|
||||
{
|
||||
@@ -2364,7 +2364,7 @@ void Map::RemoveAllObjectsInRemoveList()
|
||||
uint32 Map::GetPlayersCountExceptGMs() const
|
||||
{
|
||||
uint32 count = 0;
|
||||
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
if(!itr->getSource()->isGameMaster())
|
||||
++count;
|
||||
return count;
|
||||
@@ -2372,7 +2372,7 @@ uint32 Map::GetPlayersCountExceptGMs() const
|
||||
|
||||
void Map::SendToPlayers(WorldPacket const* data) const
|
||||
{
|
||||
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->GetSession()->SendPacket(data);
|
||||
}
|
||||
|
||||
@@ -2380,20 +2380,20 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const
|
||||
{
|
||||
ASSERT(x < MAX_NUMBER_OF_GRIDS);
|
||||
ASSERT(y < MAX_NUMBER_OF_GRIDS);
|
||||
|
||||
|
||||
CellPair cell_min(x*MAX_NUMBER_OF_CELLS, y*MAX_NUMBER_OF_CELLS);
|
||||
CellPair cell_max(cell_min.x_coord + MAX_NUMBER_OF_CELLS, cell_min.y_coord+MAX_NUMBER_OF_CELLS);
|
||||
|
||||
|
||||
//we must find visible range in cells so we unload only non-visible cells...
|
||||
float viewDist = GetVisibilityDistance();
|
||||
int cell_range = (int)ceilf(viewDist / SIZE_OF_GRID_CELL) + 1;
|
||||
|
||||
|
||||
cell_min << cell_range;
|
||||
cell_min -= cell_range;
|
||||
cell_max >> cell_range;
|
||||
cell_max += cell_range;
|
||||
|
||||
for(MapRefManager::const_iterator iter = m_mapRefManager.begin(); iter != m_mapRefManager.end(); ++iter)
|
||||
for (MapRefManager::const_iterator iter = m_mapRefManager.begin(); iter != m_mapRefManager.end(); ++iter)
|
||||
{
|
||||
Player* plr = iter->getSource();
|
||||
|
||||
@@ -2403,7 +2403,7 @@ bool Map::ActiveObjectsNearGrid(uint32 x, uint32 y) const
|
||||
return true;
|
||||
}
|
||||
|
||||
for(ActiveNonPlayers::const_iterator iter = m_activeNonPlayers.begin(); iter != m_activeNonPlayers.end(); ++iter)
|
||||
for (ActiveNonPlayers::const_iterator iter = m_activeNonPlayers.begin(); iter != m_activeNonPlayers.end(); ++iter)
|
||||
{
|
||||
WorldObject* obj = *iter;
|
||||
|
||||
@@ -2707,7 +2707,7 @@ bool InstanceMap::Reset(uint8 method)
|
||||
if(method == INSTANCE_RESET_ALL)
|
||||
{
|
||||
// notify the players to leave the instance so it can be reset
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->SendResetFailedNotify(GetId());
|
||||
}
|
||||
else
|
||||
@@ -2715,7 +2715,7 @@ bool InstanceMap::Reset(uint8 method)
|
||||
if(method == INSTANCE_RESET_GLOBAL)
|
||||
{
|
||||
// set the homebind timer for players inside (1 minute)
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->m_InstanceValid = false;
|
||||
}
|
||||
|
||||
@@ -2749,7 +2749,7 @@ void InstanceMap::PermBindAllPlayers(Player *player)
|
||||
|
||||
Group *group = player->GetGroup();
|
||||
// group members outside the instance group don't get bound
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
{
|
||||
Player* plr = itr->getSource();
|
||||
// players inside an instance cannot be bound to other instances
|
||||
@@ -2781,7 +2781,7 @@ void InstanceMap::UnloadAll()
|
||||
|
||||
void InstanceMap::SendResetWarnings(uint32 timeLeft) const
|
||||
{
|
||||
for(MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::const_iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
itr->getSource()->SendInstanceResetWarning(GetId(), itr->getSource()->GetDifficulty(), timeLeft);
|
||||
}
|
||||
|
||||
@@ -2870,7 +2870,7 @@ void BattleGroundMap::RemoveAllPlayers()
|
||||
{
|
||||
if(HavePlayers())
|
||||
{
|
||||
for(MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
for (MapRefManager::iterator itr = m_mapRefManager.begin(); itr != m_mapRefManager.end(); ++itr)
|
||||
{
|
||||
Player* plr = itr->getSource();
|
||||
if(!plr->IsBeingTeleportedFar())
|
||||
|
||||
+1
-3
@@ -52,7 +52,6 @@ struct ScriptInfo;
|
||||
struct ScriptAction;
|
||||
struct Position;
|
||||
|
||||
|
||||
typedef ACE_RW_Thread_Mutex GridRWLock;
|
||||
|
||||
template<class MUTEX, class LOCK_TYPE>
|
||||
@@ -289,7 +288,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||
void MessageDistBroadcast(Player *, WorldPacket *, float dist, bool to_self, bool own_team_only = false);
|
||||
void MessageDistBroadcast(WorldObject *, WorldPacket *, float dist);
|
||||
*/
|
||||
|
||||
|
||||
float GetVisibilityDistance() const { return m_VisibleDistance; }
|
||||
//function for setting up visibility distance for maps on per-type/per-Id basis
|
||||
virtual void InitVisibilityDistance();
|
||||
@@ -517,7 +516,6 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
|
||||
ActiveNonPlayers m_activeNonPlayers;
|
||||
ActiveNonPlayers::iterator m_activeNonPlayersIter;
|
||||
|
||||
|
||||
private:
|
||||
time_t i_gridExpiry;
|
||||
|
||||
|
||||
+17
-17
@@ -50,10 +50,10 @@ MapManager::MapManager() : i_gridCleanUpDelay(sWorld.getConfig(CONFIG_INTERVAL_G
|
||||
|
||||
MapManager::~MapManager()
|
||||
{
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
delete iter->second;
|
||||
|
||||
for(TransportSet::iterator i = m_Transports.begin(); i != m_Transports.end(); ++i)
|
||||
for (TransportSet::iterator i = m_Transports.begin(); i != m_Transports.end(); ++i)
|
||||
delete *i;
|
||||
|
||||
Map::DeleteStateMachine();
|
||||
@@ -66,7 +66,7 @@ MapManager::Initialize()
|
||||
|
||||
// debugging code, should be deleted some day
|
||||
{
|
||||
for(int i=0;i<MAX_GRID_STATE; i++)
|
||||
for (int i=0; i<MAX_GRID_STATE; i++)
|
||||
{
|
||||
i_GridStates[i] = si_GridStates[i];
|
||||
}
|
||||
@@ -78,7 +78,7 @@ MapManager::Initialize()
|
||||
|
||||
void MapManager::InitializeVisibilityDistanceInfo()
|
||||
{
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
(*iter).second->InitVisibilityDistance();
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ void MapManager::InitializeVisibilityDistanceInfo()
|
||||
void MapManager::checkAndCorrectGridStatesArray()
|
||||
{
|
||||
bool ok = true;
|
||||
for(int i=0;i<MAX_GRID_STATE; i++)
|
||||
for (int i=0; i<MAX_GRID_STATE; i++)
|
||||
{
|
||||
if(i_GridStates[i] != si_GridStates[i])
|
||||
{
|
||||
@@ -262,14 +262,14 @@ MapManager::Update(uint32 diff)
|
||||
MapMapType::iterator iter;
|
||||
std::vector<Map*> update_queue(i_maps.size());
|
||||
int omp_set_num_threads(sWorld.getConfig(CONFIG_NUMTHREADS));
|
||||
for(iter = i_maps.begin(), i=0;iter != i_maps.end(); ++iter, i++)
|
||||
for (iter = i_maps.begin(), i=0; iter != i_maps.end(); ++iter, i++)
|
||||
update_queue[i]=iter->second;
|
||||
/*
|
||||
gomp in gcc <4.4 version cannot parallelise loops using random access iterators
|
||||
so until gcc 4.4 isnt standard, we need the update_queue workaround
|
||||
*/
|
||||
#pragma omp parallel for schedule(dynamic) private(i) shared(update_queue)
|
||||
for(int32 i = 0; i < i_maps.size(); ++i)
|
||||
for (int32 i = 0; i < i_maps.size(); ++i)
|
||||
{
|
||||
checkAndCorrectGridStatesArray(); // debugging code, should be deleted some day
|
||||
update_queue[i]->Update(i_timer.GetCurrent());
|
||||
@@ -277,14 +277,14 @@ MapManager::Update(uint32 diff)
|
||||
// sLog.outError("This is thread %d out of %d threads,updating map %u",omp_get_thread_num(),omp_get_num_threads(),iter->second->GetId());
|
||||
}
|
||||
#else
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
{
|
||||
iter->second->Update(i_timer.GetCurrent());
|
||||
sWorld.RecordTimeDiff("UpdateMap %u", iter->second->GetId());
|
||||
}
|
||||
#endif
|
||||
|
||||
for(MapMapType::iterator iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
for (MapMapType::iterator iter = i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
iter->second->DelayedUpdate(i_timer.GetCurrent());
|
||||
|
||||
ObjectAccessor::Instance().Update(i_timer.GetCurrent());
|
||||
@@ -302,13 +302,13 @@ void MapManager::DoDelayedMovesAndRemoves()
|
||||
int i =0;
|
||||
std::vector<Map*> update_queue(i_maps.size());
|
||||
MapMapType::iterator iter;
|
||||
for(iter = i_maps.begin();iter != i_maps.end(); ++iter, i++)
|
||||
for (iter = i_maps.begin(); iter != i_maps.end(); ++iter, i++)
|
||||
update_queue[i] = iter->second;
|
||||
|
||||
omp_set_num_threads(sWorld.getConfig(CONFIG_NUMTHREADS));
|
||||
|
||||
|
||||
#pragma omp parallel for schedule(dynamic) private(i) shared(update_queue)
|
||||
for(i=0;i<i_maps.size();i++)
|
||||
for (i=0; i<i_maps.size(); i++)
|
||||
update_queue[i]->DoDelayedMovesAndRemoves();
|
||||
*/
|
||||
}
|
||||
@@ -332,7 +332,7 @@ bool MapManager::IsValidMAP(uint32 mapid)
|
||||
|
||||
void MapManager::UnloadAll()
|
||||
{
|
||||
for(MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
for (MapMapType::iterator iter=i_maps.begin(); iter != i_maps.end(); ++iter)
|
||||
iter->second->UnloadAll();
|
||||
|
||||
while(!i_maps.empty())
|
||||
@@ -357,12 +357,12 @@ void MapManager::InitMaxInstanceId()
|
||||
uint32 MapManager::GetNumInstances()
|
||||
{
|
||||
uint32 ret = 0;
|
||||
for(MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
{
|
||||
Map *map = itr->second;
|
||||
if(!map->Instanceable()) continue;
|
||||
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
||||
for(MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
if(mitr->second->IsDungeon()) ret++;
|
||||
}
|
||||
return ret;
|
||||
@@ -371,12 +371,12 @@ uint32 MapManager::GetNumInstances()
|
||||
uint32 MapManager::GetNumPlayersInInstances()
|
||||
{
|
||||
uint32 ret = 0;
|
||||
for(MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
for (MapMapType::iterator itr = i_maps.begin(); itr != i_maps.end(); ++itr)
|
||||
{
|
||||
Map *map = itr->second;
|
||||
if(!map->Instanceable()) continue;
|
||||
MapInstanced::InstancedMaps &maps = ((MapInstanced *)map)->GetInstancedMaps();
|
||||
for(MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
for (MapInstanced::InstancedMaps::iterator mitr = maps.begin(); mitr != maps.end(); ++mitr)
|
||||
if(mitr->second->IsDungeon())
|
||||
ret += ((InstanceMap*)mitr->second)->GetPlayers().getSize();
|
||||
}
|
||||
|
||||
@@ -169,7 +169,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
if(zones_count > 10)
|
||||
return; // can't be received from real client or broken packet
|
||||
|
||||
for(uint32 i = 0; i < zones_count; ++i)
|
||||
for (uint32 i = 0; i < zones_count; ++i)
|
||||
{
|
||||
uint32 temp;
|
||||
recv_data >> temp; // zone id, 0 if zone is unknown...
|
||||
@@ -185,7 +185,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
sLog.outDebug("Minlvl %u, maxlvl %u, name %s, guild %s, racemask %u, classmask %u, zones %u, strings %u", level_min, level_max, player_name.c_str(), guild_name.c_str(), racemask, classmask, zones_count, str_count);
|
||||
|
||||
std::wstring str[4]; // 4 is client limit
|
||||
for(uint32 i = 0; i < str_count; ++i)
|
||||
for (uint32 i = 0; i < str_count; ++i)
|
||||
{
|
||||
std::string temp;
|
||||
recv_data >> temp; // user entered string, it used as universal search pattern(guild+player name)?
|
||||
@@ -221,7 +221,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
|
||||
//TODO: Guard Player map
|
||||
HashMapHolder<Player>::MapType& m = ObjectAccessor::Instance().GetPlayers();
|
||||
for(HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
for (HashMapHolder<Player>::MapType::const_iterator itr = m.begin(); itr != m.end(); ++itr)
|
||||
{
|
||||
if (security == SEC_PLAYER)
|
||||
{
|
||||
@@ -260,7 +260,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
uint32 pzoneid = itr->second->GetZoneId();
|
||||
|
||||
bool z_show = true;
|
||||
for(uint32 i = 0; i < zones_count; ++i)
|
||||
for (uint32 i = 0; i < zones_count; ++i)
|
||||
{
|
||||
if(zoneids[i] == pzoneid)
|
||||
{
|
||||
@@ -296,7 +296,7 @@ void WorldSession::HandleWhoOpcode( WorldPacket & recv_data )
|
||||
aname = areaEntry->area_name[GetSessionDbcLocale()];
|
||||
|
||||
bool s_show = true;
|
||||
for(uint32 i = 0; i < str_count; ++i)
|
||||
for (uint32 i = 0; i < str_count; ++i)
|
||||
{
|
||||
if (!str[i].empty())
|
||||
{
|
||||
@@ -1177,8 +1177,8 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
|
||||
uint32 talent_points = 0x47;
|
||||
uint32 guid_size = plr->GetPackGUID().wpos();
|
||||
WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points);
|
||||
uint32 guid_size = plr->GetPackGUID().wpos();
|
||||
WorldPacket data(SMSG_INSPECT_TALENT, guid_size+4+talent_points);
|
||||
data.append(plr->GetPackGUID());
|
||||
|
||||
if(sWorld.getConfig(CONFIG_TALENTS_INSPECTING) || _player->isGameMaster())
|
||||
|
||||
@@ -530,11 +530,11 @@ void MotionMaster::MoveRotate(uint32 time, RotateDirection direction)
|
||||
void MotionMaster::propagateSpeedChange()
|
||||
{
|
||||
/*Impl::container_type::iterator it = Impl::c.begin();
|
||||
for ( ;it != end(); ++it)
|
||||
for (; it != end(); ++it)
|
||||
{
|
||||
(*it)->unitSpeedChanged();
|
||||
}*/
|
||||
for(int i = 0; i <= i_top; ++i)
|
||||
for (int i = 0; i <= i_top; ++i)
|
||||
{
|
||||
if(Impl[i])
|
||||
Impl[i]->unitSpeedChanged();
|
||||
@@ -585,7 +585,7 @@ bool MotionMaster::GetDestination(float &x, float &y, float &z)
|
||||
{
|
||||
if(empty())
|
||||
return false;
|
||||
|
||||
|
||||
return top()->GetDestination(x,y,z);
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ class TRINITY_DLL_SPEC MotionMaster //: private std::stack<MovementGenerator *>
|
||||
|
||||
explicit MotionMaster(Unit *unit) : i_owner(unit), m_expList(NULL), m_cleanFlag(MMCF_NONE), i_top(-1)
|
||||
{
|
||||
for(uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
for (uint8 i = 0; i < MAX_MOTION_SLOT; ++i)
|
||||
{
|
||||
Impl[i] = NULL;
|
||||
needInit[i] = true;
|
||||
|
||||
@@ -486,7 +486,7 @@ void WorldSession::HandleSetActiveMoverOpcode(WorldPacket &recv_data)
|
||||
else
|
||||
{
|
||||
sLog.outError("HandleSetActiveMoverOpcode: incorrect mover guid: mover is " UI64FMTD " and should be " UI64FMTD, guid, _player->m_mover->GetGUID());
|
||||
GetPlayer()->SetMover(GetPlayer());
|
||||
GetPlayer()->SetMover(GetPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -154,7 +154,7 @@ void WorldSession::SendTrainerList( uint64 guid, const std::string& strTitle )
|
||||
bool can_learn_primary_prof = GetPlayer()->GetFreePrimaryProfessionPoints() > 0;
|
||||
|
||||
uint32 count = 0;
|
||||
for(TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
|
||||
for (TrainerSpellMap::const_iterator itr = trainer_spells->spellList.begin(); itr != trainer_spells->spellList.end(); ++itr)
|
||||
{
|
||||
TrainerSpell const* tSpell = &itr->second;
|
||||
|
||||
|
||||
+14
-14
@@ -353,7 +353,7 @@ void Object::_BuildMovementUpdate(ByteBuffer * data, uint16 flags) const
|
||||
uint32 poscount = uint32(path.Size());
|
||||
*data << uint32(poscount); // points count
|
||||
|
||||
for(uint32 i = 0; i < poscount; ++i)
|
||||
for (uint32 i = 0; i < poscount; ++i)
|
||||
{
|
||||
*data << path.GetNodes()[i].x;
|
||||
*data << path.GetNodes()[i].y;
|
||||
@@ -527,7 +527,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
// 2 specialized loops for speed optimization in non-unit case
|
||||
if(isType(TYPEMASK_UNIT)) // unit (creature/player) case
|
||||
{
|
||||
for( uint16 index = 0; index < m_valuesCount; ++index )
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index )
|
||||
{
|
||||
if( updateMask->GetBit( index ) )
|
||||
{
|
||||
@@ -639,7 +639,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
}
|
||||
else
|
||||
*data << m_uint32Values[ index ];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// send in current format (float as float, uint32 as uint32)
|
||||
@@ -650,7 +650,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
}
|
||||
else if(isType(TYPEMASK_GAMEOBJECT)) // gameobject case
|
||||
{
|
||||
for( uint16 index = 0; index < m_valuesCount; ++index )
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index )
|
||||
{
|
||||
if( updateMask->GetBit( index ) )
|
||||
{
|
||||
@@ -691,7 +691,7 @@ void Object::_BuildValuesUpdate(uint8 updatetype, ByteBuffer * data, UpdateMask
|
||||
}
|
||||
else // other objects case (no special index checks)
|
||||
{
|
||||
for( uint16 index = 0; index < m_valuesCount; ++index )
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index )
|
||||
{
|
||||
if( updateMask->GetBit( index ) )
|
||||
{
|
||||
@@ -752,7 +752,7 @@ void Object::_SetUpdateBits(UpdateMask *updateMask, Player* /*target*/) const
|
||||
uint32 *value = m_uint32Values;
|
||||
uint32 *mirror = m_uint32Values_mirror;
|
||||
|
||||
for(uint16 index = 0; index < m_valuesCount; ++index, ++value, ++mirror)
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index, ++value, ++mirror)
|
||||
{
|
||||
if(*mirror != *value)
|
||||
updateMask->SetBit(index);
|
||||
@@ -763,7 +763,7 @@ void Object::_SetCreateBits(UpdateMask *updateMask, Player* /*target*/) const
|
||||
{
|
||||
uint32 *value = m_uint32Values;
|
||||
|
||||
for(uint16 index = 0; index < m_valuesCount; ++index, ++value)
|
||||
for (uint16 index = 0; index < m_valuesCount; ++index, ++value)
|
||||
{
|
||||
if(*value)
|
||||
updateMask->SetBit(index);
|
||||
@@ -1551,7 +1551,7 @@ void WorldObject::MonsterYellToZone(int32 textId, uint32 language, uint64 Target
|
||||
uint32 zoneid = GetZoneId();
|
||||
|
||||
Map::PlayerList const& pList = GetMap()->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
if(itr->getSource()->GetZoneId()==zoneid)
|
||||
say_do(itr->getSource());
|
||||
}
|
||||
@@ -1783,7 +1783,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
{
|
||||
// Remove Demonic Sacrifice auras (known pet)
|
||||
Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
|
||||
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end(); )
|
||||
{
|
||||
if((*itr)->GetMiscValue()==2228)
|
||||
{
|
||||
@@ -1864,7 +1864,7 @@ Pet* Player::SummonPet(uint32 entry, float x, float y, float z, float ang, PetTy
|
||||
{
|
||||
// Remove Demonic Sacrifice auras (known pet)
|
||||
Unit::AuraEffectList const& auraClassScripts = GetAurasByType(SPELL_AURA_OVERRIDE_CLASS_SCRIPTS);
|
||||
for(Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin();itr!=auraClassScripts.end();)
|
||||
for (Unit::AuraEffectList::const_iterator itr = auraClassScripts.begin(); itr!=auraClassScripts.end(); )
|
||||
{
|
||||
if((*itr)->GetMiscValue()==2228)
|
||||
{
|
||||
@@ -2238,7 +2238,7 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
Trinity::AnyUnitInObjectRangeCheck check(this, GetMap()->GetVisibilityDistance());
|
||||
Trinity::UnitListSearcher<Trinity::AnyUnitInObjectRangeCheck> searcher(this, targets, check);
|
||||
VisitNearbyWorldObject(GetMap()->GetVisibilityDistance(), searcher);
|
||||
for(std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
for (std::list<Unit*>::const_iterator iter = targets.begin(); iter != targets.end(); ++iter)
|
||||
{
|
||||
Player *plr = dynamic_cast<Player*>(*iter);
|
||||
if(!plr)
|
||||
@@ -2252,8 +2252,8 @@ void WorldObject::DestroyForNearbyPlayers()
|
||||
|
||||
if(isType(TYPEMASK_UNIT) && ((Unit*)this)->GetCharmerGUID() == plr->GetGUID()) // TODO: this is for puppet
|
||||
continue;
|
||||
|
||||
DestroyForPlayer(plr);
|
||||
plr->m_clientGUIDs.erase(GetGUID());
|
||||
|
||||
DestroyForPlayer(plr);
|
||||
plr->m_clientGUIDs.erase(GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -48,7 +48,7 @@ INSTANTIATE_CLASS_MUTEX(ObjectAccessor, ACE_Thread_Mutex);
|
||||
ObjectAccessor::ObjectAccessor() {}
|
||||
ObjectAccessor::~ObjectAccessor()
|
||||
{
|
||||
for(Player2CorpsesMapType::const_iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); ++itr)
|
||||
for (Player2CorpsesMapType::const_iterator itr = i_player2corpse.begin(); itr != i_player2corpse.end(); ++itr)
|
||||
delete itr->second;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,7 @@ ObjectAccessor::FindPlayerByName(const char *name)
|
||||
//TODO: Player Guard
|
||||
HashMapHolder<Player>::MapType& m = HashMapHolder<Player>::GetContainer();
|
||||
HashMapHolder<Player>::MapType::iterator iter = m.begin();
|
||||
for(; iter != m.end(); ++iter)
|
||||
for (; iter != m.end(); ++iter)
|
||||
if(iter->second->IsInWorld() && ( ::strcmp(name, iter->second->GetName()) == 0 ))
|
||||
return iter->second;
|
||||
return NULL;
|
||||
@@ -176,7 +176,7 @@ ObjectAccessor::SaveAllPlayers()
|
||||
Guard guard(*HashMapHolder<Player*>::GetLock());
|
||||
HashMapHolder<Player>::MapType& m = HashMapHolder<Player>::GetContainer();
|
||||
HashMapHolder<Player>::MapType::iterator itr = m.begin();
|
||||
for(; itr != m.end(); ++itr)
|
||||
for (; itr != m.end(); ++itr)
|
||||
itr->second->SaveToDB();
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ ObjectAccessor::UpdateObject(Object* obj, Player* exceptPlayer)
|
||||
obj->BuildUpdate(update_players);
|
||||
|
||||
WorldPacket packet;
|
||||
for(UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
|
||||
for (UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
|
||||
{
|
||||
if(iter->first == exceptPlayer)
|
||||
continue;
|
||||
@@ -303,7 +303,7 @@ void
|
||||
ObjectAccessor::AddCorpsesToGrid(GridPair const& gridpair,GridType& grid,Map* map)
|
||||
{
|
||||
Guard guard(i_corpseGuard);
|
||||
for(Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter)
|
||||
for (Player2CorpsesMapType::iterator iter = i_player2corpse.begin(); iter != i_player2corpse.end(); ++iter)
|
||||
if(iter->second->GetGrid() == gridpair)
|
||||
{
|
||||
// verify, if the corpse in our instance (add only corpses which are)
|
||||
@@ -407,7 +407,7 @@ ObjectAccessor::Update(uint32 diff)
|
||||
}
|
||||
|
||||
WorldPacket packet; // here we allocate a std::vector with a size of 0x10000
|
||||
for(UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
|
||||
for (UpdateDataMapType::iterator iter = update_players.begin(); iter != update_players.end(); ++iter)
|
||||
{
|
||||
iter->second.BuildPacket(&packet);
|
||||
iter->first->GetSession()->SendPacket(&packet);
|
||||
@@ -418,13 +418,13 @@ ObjectAccessor::Update(uint32 diff)
|
||||
void
|
||||
ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)
|
||||
{
|
||||
for(PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (PlayerMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
BuildPacket(iter->getSource());
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
{
|
||||
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
|
||||
for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
|
||||
for (; it != iter->getSource()->GetSharedVisionList().end(); ++it)
|
||||
BuildPacket(*it);
|
||||
}
|
||||
}
|
||||
@@ -433,12 +433,12 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(PlayerMapType &m)
|
||||
void
|
||||
ObjectAccessor::WorldObjectChangeAccumulator::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
if (!iter->getSource()->GetSharedVisionList().empty())
|
||||
{
|
||||
SharedVisionList::const_iterator it = iter->getSource()->GetSharedVisionList().begin();
|
||||
for ( ; it != iter->getSource()->GetSharedVisionList().end(); ++it)
|
||||
for (; it != iter->getSource()->GetSharedVisionList().end(); ++it)
|
||||
BuildPacket(*it);
|
||||
}
|
||||
}
|
||||
@@ -447,7 +447,7 @@ ObjectAccessor::WorldObjectChangeAccumulator::Visit(CreatureMapType &m)
|
||||
void
|
||||
ObjectAccessor::WorldObjectChangeAccumulator::Visit(DynamicObjectMapType &m)
|
||||
{
|
||||
for(DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (DynamicObjectMapType::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
uint64 guid = iter->getSource()->GetCasterGUID();
|
||||
if(IS_PLAYER_GUID(guid))
|
||||
|
||||
@@ -133,7 +133,6 @@ class MANGOS_DLL_DECL ObjectAccessor : public MaNGOS::Singleton<ObjectAccessor,
|
||||
return GetObjectInWorld(guid, ((Unit*)NULL));
|
||||
}
|
||||
|
||||
|
||||
template<class T> static T* GetObjectInWorld(uint32 mapid, float x, float y, uint64 guid, T* /*fake*/)
|
||||
{
|
||||
T* obj = HashMapHolder<T>::Find(guid);
|
||||
|
||||
@@ -54,7 +54,7 @@ ObjectGridRespawnMover::Visit(CreatureMapType &m)
|
||||
// creature in unloading grid can have respawn point in another grid
|
||||
// if it will be unloaded then it will not respawn in original grid until unload/load original grid
|
||||
// move to respawn point to prevent this case. For player view in respawn grid this will be normal respawn.
|
||||
for(CreatureMapType::iterator iter = m.begin(); iter != m.end();)
|
||||
for (CreatureMapType::iterator iter = m.begin(); iter != m.end(); )
|
||||
{
|
||||
Creature * c = iter->getSource();
|
||||
++iter;
|
||||
@@ -124,7 +124,7 @@ void AddObjectHelper(CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* m
|
||||
template <class T>
|
||||
void LoadHelper(CellGuidSet const& guid_set, CellPair &cell, GridRefManager<T> &m, uint32 &count, Map* map)
|
||||
{
|
||||
for(CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
for (CellGuidSet::const_iterator i_guid = guid_set.begin(); i_guid != guid_set.end(); ++i_guid)
|
||||
{
|
||||
T* obj = new T;
|
||||
uint32 guid = *i_guid;
|
||||
@@ -144,7 +144,7 @@ void LoadHelper(CellCorpseSet const& cell_corpses, CellPair &cell, CorpseMapType
|
||||
if(cell_corpses.empty())
|
||||
return;
|
||||
|
||||
for(CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
|
||||
for (CellCorpseSet::const_iterator itr = cell_corpses.begin(); itr != cell_corpses.end(); ++itr)
|
||||
{
|
||||
if(itr->second != map->GetInstanceId())
|
||||
continue;
|
||||
@@ -224,10 +224,10 @@ void ObjectGridLoader::LoadN(void)
|
||||
{
|
||||
i_gameObjects = 0; i_creatures = 0; i_corpses = 0;
|
||||
i_cell.data.Part.cell_y = 0;
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
i_cell.data.Part.cell_x = x;
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
i_cell.data.Part.cell_y = y;
|
||||
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
|
||||
@@ -239,9 +239,9 @@ void ObjectGridLoader::LoadN(void)
|
||||
|
||||
void ObjectGridUnloader::MoveToRespawnN()
|
||||
{
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
ObjectGridRespawnMover mover;
|
||||
mover.Move(i_grid(x, y));
|
||||
@@ -282,7 +282,7 @@ void
|
||||
ObjectGridStoper::Visit(CreatureMapType &m)
|
||||
{
|
||||
// stop any fights at grid de-activation and remove dynobjects created at cast by creatures
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
{
|
||||
iter->getSource()->RemoveAllDynObjects();
|
||||
if(iter->getSource()->isInCombat())
|
||||
@@ -304,7 +304,7 @@ ObjectGridCleaner::Stop(GridType &grid)
|
||||
void
|
||||
ObjectGridCleaner::Visit(CreatureMapType &m)
|
||||
{
|
||||
for(CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
for (CreatureMapType::iterator iter=m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->CleanupsBeforeDelete();
|
||||
}
|
||||
|
||||
@@ -312,7 +312,7 @@ template<class T>
|
||||
void
|
||||
ObjectGridCleaner::Visit(GridRefManager<T> &m)
|
||||
{
|
||||
for(typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
for (typename GridRefManager<T>::iterator iter = m.begin(); iter != m.end(); ++iter)
|
||||
iter->getSource()->RemoveFromWorld();
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ class TRINITY_DLL_DECL ObjectGridUnloader
|
||||
void MoveToRespawnN();
|
||||
void UnloadN()
|
||||
{
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
|
||||
loader.Unload(i_grid(x, y), *this);
|
||||
@@ -87,9 +87,9 @@ class TRINITY_DLL_DECL ObjectGridStoper
|
||||
|
||||
void StopN()
|
||||
{
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
|
||||
loader.Stop(i_grid(x, y), *this);
|
||||
@@ -112,9 +112,9 @@ class TRINITY_DLL_DECL ObjectGridCleaner
|
||||
|
||||
void CleanN()
|
||||
{
|
||||
for(unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
for (unsigned int x=0; x < MAX_NUMBER_OF_CELLS; ++x)
|
||||
{
|
||||
for(unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
for (unsigned int y=0; y < MAX_NUMBER_OF_CELLS; ++y)
|
||||
{
|
||||
GridLoader<Player, AllWorldObjectTypes, AllGridObjectTypes> loader;
|
||||
loader.Stop(i_grid(x, y), *this);
|
||||
|
||||
+109
-110
@@ -67,7 +67,7 @@ bool normalizePlayerName(std::string& name)
|
||||
return false;
|
||||
|
||||
wstr_buf[0] = wcharToUpper(wstr_buf[0]);
|
||||
for(size_t i = 1; i < wstr_len; ++i)
|
||||
for (size_t i = 1; i < wstr_len; ++i)
|
||||
wstr_buf[i] = wcharToLower(wstr_buf[i]);
|
||||
|
||||
if(!WStrToUtf8(wstr_buf,wstr_len,name))
|
||||
@@ -101,7 +101,7 @@ LanguageDesc lang_description[LANGUAGES_COUNT] =
|
||||
|
||||
LanguageDesc const* GetLanguageDescByID(uint32 lang)
|
||||
{
|
||||
for(uint8 i = 0; i < LANGUAGES_COUNT; ++i)
|
||||
for (uint8 i = 0; i < LANGUAGES_COUNT; ++i)
|
||||
{
|
||||
if(uint32(lang_description[i].lang_id) == lang)
|
||||
return &lang_description[i];
|
||||
@@ -184,10 +184,10 @@ ObjectMgr::ObjectMgr()
|
||||
|
||||
ObjectMgr::~ObjectMgr()
|
||||
{
|
||||
for( QuestMap::iterator i = mQuestTemplates.begin( ); i != mQuestTemplates.end( ); ++i )
|
||||
for (QuestMap::iterator i = mQuestTemplates.begin( ); i != mQuestTemplates.end( ); ++i )
|
||||
delete i->second;
|
||||
|
||||
for(PetLevelInfoMap::iterator i = petInfo.begin( ); i != petInfo.end( ); ++i )
|
||||
for (PetLevelInfoMap::iterator i = petInfo.begin( ); i != petInfo.end( ); ++i )
|
||||
delete[] i->second;
|
||||
|
||||
// free only if loaded
|
||||
@@ -276,7 +276,7 @@ PCachePlayerInfo ObjectMgr::GetPlayerInfoFromCache(uint32 unPlayerGuid) const
|
||||
|
||||
Group * ObjectMgr::GetGroupByLeader(const uint64 &guid) const
|
||||
{
|
||||
for(GroupSet::const_iterator itr = mGroupSet.begin(); itr != mGroupSet.end(); ++itr)
|
||||
for (GroupSet::const_iterator itr = mGroupSet.begin(); itr != mGroupSet.end(); ++itr)
|
||||
if ((*itr)->GetLeaderGUID() == guid)
|
||||
return *itr;
|
||||
|
||||
@@ -294,7 +294,7 @@ Guild * ObjectMgr::GetGuildById(uint32 GuildId) const
|
||||
|
||||
Guild * ObjectMgr::GetGuildByName(const std::string& guildname) const
|
||||
{
|
||||
for(GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
|
||||
for (GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
|
||||
if (itr->second->GetName() == guildname)
|
||||
return itr->second;
|
||||
|
||||
@@ -312,7 +312,7 @@ std::string ObjectMgr::GetGuildNameById(uint32 GuildId) const
|
||||
|
||||
Guild* ObjectMgr::GetGuildByLeader(const uint64 &guid) const
|
||||
{
|
||||
for(GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
|
||||
for (GuildMap::const_iterator itr = mGuildMap.begin(); itr != mGuildMap.end(); ++itr)
|
||||
if (itr->second->GetLeader() == guid)
|
||||
return itr->second;
|
||||
|
||||
@@ -340,7 +340,7 @@ ArenaTeam* ObjectMgr::GetArenaTeamById(uint32 arenateamid) const
|
||||
|
||||
ArenaTeam* ObjectMgr::GetArenaTeamByName(const std::string& arenateamname) const
|
||||
{
|
||||
for(ArenaTeamMap::const_iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
|
||||
for (ArenaTeamMap::const_iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
|
||||
if (itr->second->GetName() == arenateamname)
|
||||
return itr->second;
|
||||
|
||||
@@ -349,7 +349,7 @@ ArenaTeam* ObjectMgr::GetArenaTeamByName(const std::string& arenateamname) const
|
||||
|
||||
ArenaTeam* ObjectMgr::GetArenaTeamByCaptain(uint64 const& guid) const
|
||||
{
|
||||
for(ArenaTeamMap::const_iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
|
||||
for (ArenaTeamMap::const_iterator itr = mArenaTeamMap.begin(); itr != mArenaTeamMap.end(); ++itr)
|
||||
if (itr->second->GetCaptain() == guid)
|
||||
return itr->second;
|
||||
|
||||
@@ -399,7 +399,7 @@ void ObjectMgr::LoadCreatureLocales()
|
||||
|
||||
CreatureLocale& data = mCreatureLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[1+2*(i-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -467,7 +467,7 @@ void ObjectMgr::LoadNpcOptionLocales()
|
||||
|
||||
NpcOptionLocale& data = mNpcOptionLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[1+2*(i-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -530,7 +530,7 @@ void ObjectMgr::LoadPointOfInterestLocales()
|
||||
|
||||
PointOfInterestLocale& data = mPointOfInterestLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i].GetCppString();
|
||||
if(str.empty())
|
||||
@@ -574,7 +574,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
std::set<uint32> hasHeroicEntries; // already loaded creatures with heroic entry values
|
||||
|
||||
// check data correctness
|
||||
for(uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sCreatureStorage.MaxEntry; ++i)
|
||||
{
|
||||
CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i);
|
||||
if (!cInfo)
|
||||
@@ -737,7 +737,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
if (!displayScaleEntry)
|
||||
sLog.outErrorDb("Creature (Entry: %u) not has any existed display id in Modelid1/Modelid2/Modelid3/Modelid4", cInfo->Entry);
|
||||
|
||||
for(int k = 0; k < MAX_KILL_CREDIT; ++k)
|
||||
for (int k = 0; k < MAX_KILL_CREDIT; ++k)
|
||||
{
|
||||
if(cInfo->KillCredit[k])
|
||||
{
|
||||
@@ -799,7 +799,7 @@ void ObjectMgr::LoadCreatureTemplates()
|
||||
sLog.outErrorDb("Creature (Entry: %u) has non-existing PetSpellDataId (%u)", cInfo->Entry, cInfo->PetSpellDataId);
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j)
|
||||
for (uint8 j = 0; j < CREATURE_MAX_SPELLS; ++j)
|
||||
{
|
||||
if(cInfo->spells[j] && !sSpellStore.LookupEntry(cInfo->spells[j]))
|
||||
{
|
||||
@@ -879,7 +879,7 @@ void ObjectMgr::ConvertCreatureAddonAuras(CreatureDataAddon* addon, char const*
|
||||
const_cast<CreatureDataAddonAura*&>(addon->auras) = new CreatureDataAddonAura[val.size()/2+1];
|
||||
|
||||
uint32 i=0;
|
||||
for(uint32 j = 0; j < val.size()/2;++j)
|
||||
for (uint32 j = 0; j < val.size()/2; ++j)
|
||||
{
|
||||
CreatureDataAddonAura& cAura = const_cast<CreatureDataAddonAura&>(addon->auras[i]);
|
||||
cAura.spell_id = (uint32)val[2*j+0];
|
||||
@@ -919,7 +919,7 @@ void ObjectMgr::LoadCreatureAddons(SQLStorage& creatureaddons, char const* entry
|
||||
sLog.outString();
|
||||
|
||||
// check data correctness and convert 'auras'
|
||||
for(uint32 i = 1; i < creatureaddons.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < creatureaddons.MaxEntry; ++i)
|
||||
{
|
||||
CreatureDataAddon const* addon = creatureaddons.LookupEntry<CreatureDataAddon>(i);
|
||||
if(!addon)
|
||||
@@ -952,7 +952,7 @@ void ObjectMgr::LoadCreatureAddons()
|
||||
LoadCreatureAddons(sCreatureInfoAddonStorage,"Entry","creature template addons");
|
||||
|
||||
// check entry ids
|
||||
for(uint32 i = 1; i < sCreatureInfoAddonStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sCreatureInfoAddonStorage.MaxEntry; ++i)
|
||||
if(CreatureDataAddon const* addon = sCreatureInfoAddonStorage.LookupEntry<CreatureDataAddon>(i))
|
||||
if(!sCreatureStorage.LookupEntry<CreatureInfo>(addon->guidOrEntry))
|
||||
sLog.outErrorDb("Creature (Entry: %u) does not exist but has a record in `%s`",addon->guidOrEntry, sCreatureInfoAddonStorage.GetTableName());
|
||||
@@ -960,7 +960,7 @@ void ObjectMgr::LoadCreatureAddons()
|
||||
LoadCreatureAddons(sCreatureDataAddonStorage,"GUID","creature addons");
|
||||
|
||||
// check entry ids
|
||||
for(uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sCreatureDataAddonStorage.MaxEntry; ++i)
|
||||
if(CreatureDataAddon const* addon = sCreatureDataAddonStorage.LookupEntry<CreatureDataAddon>(i))
|
||||
if(mCreatureDataMap.find(addon->guidOrEntry)==mCreatureDataMap.end())
|
||||
sLog.outErrorDb("Creature (GUID: %u) does not exist but has a record in `creature_addon`",addon->guidOrEntry);
|
||||
@@ -975,14 +975,14 @@ void ObjectMgr::LoadEquipmentTemplates()
|
||||
{
|
||||
sEquipmentStorage.Load();
|
||||
|
||||
for(uint32 i=0; i< sEquipmentStorage.MaxEntry; ++i)
|
||||
for (uint32 i=0; i< sEquipmentStorage.MaxEntry; ++i)
|
||||
{
|
||||
EquipmentInfo const* eqInfo = sEquipmentStorage.LookupEntry<EquipmentInfo>(i);
|
||||
|
||||
if(!eqInfo)
|
||||
continue;
|
||||
|
||||
for(uint8 j=0; j<3; j++)
|
||||
for (uint8 j=0; j<3; j++)
|
||||
{
|
||||
if(!eqInfo->equipentry[j])
|
||||
continue;
|
||||
@@ -1080,7 +1080,7 @@ void ObjectMgr::LoadCreatureModelInfo()
|
||||
sCreatureModelStorage.Load();
|
||||
|
||||
// post processing
|
||||
for(uint32 i = 1; i < sCreatureModelStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sCreatureModelStorage.MaxEntry; ++i)
|
||||
{
|
||||
CreatureModelInfo const *minfo = sCreatureModelStorage.LookupEntry<CreatureModelInfo>(i);
|
||||
if (!minfo)
|
||||
@@ -1106,7 +1106,7 @@ void ObjectMgr::LoadCreatureModelInfo()
|
||||
sLog.outString();
|
||||
|
||||
// check if combat_reach is valid
|
||||
for(uint32 i = 1; i < sCreatureModelStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sCreatureModelStorage.MaxEntry; ++i)
|
||||
{
|
||||
CreatureModelInfo const* mInfo = sCreatureModelStorage.LookupEntry<CreatureModelInfo>(i);
|
||||
if(!mInfo)
|
||||
@@ -1124,7 +1124,7 @@ bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const
|
||||
{
|
||||
const CreatureData* const slave = GetCreatureData(guid);
|
||||
const CreatureData* const master = GetCreatureData(linkedGuid);
|
||||
|
||||
|
||||
if(!slave || !master) // they must have a corresponding entry in db
|
||||
{
|
||||
sLog.outError("LinkedRespawn: Creature '%u' linking to '%u' which doesn't exist",guid,linkedGuid);
|
||||
@@ -1132,7 +1132,7 @@ bool ObjectMgr::CheckCreatureLinkedRespawn(uint32 guid, uint32 linkedGuid) const
|
||||
}
|
||||
|
||||
const MapEntry* const map = sMapStore.LookupEntry(master->mapid);
|
||||
|
||||
|
||||
if(master->mapid != slave->mapid // link only to same map
|
||||
&& (!map || map->Instanceable())) // or to unistanced world
|
||||
{
|
||||
@@ -1233,7 +1233,7 @@ void ObjectMgr::LoadCreatures()
|
||||
|
||||
// build single time for check creature data
|
||||
std::set<uint32> heroicCreatures;
|
||||
for(uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 0; i < sCreatureStorage.MaxEntry; ++i)
|
||||
if(CreatureInfo const* cInfo = sCreatureStorage.LookupEntry<CreatureInfo>(i))
|
||||
if(cInfo->HeroicEntry)
|
||||
heroicCreatures.insert(cInfo->HeroicEntry);
|
||||
@@ -1384,7 +1384,7 @@ void ObjectMgr::LoadCreatures()
|
||||
void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
|
||||
{
|
||||
uint8 mask = data->spawnMask;
|
||||
for(uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
for (uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
{
|
||||
if(mask & 1)
|
||||
{
|
||||
@@ -1400,7 +1400,7 @@ void ObjectMgr::AddCreatureToGrid(uint32 guid, CreatureData const* data)
|
||||
void ObjectMgr::RemoveCreatureFromGrid(uint32 guid, CreatureData const* data)
|
||||
{
|
||||
uint8 mask = data->spawnMask;
|
||||
for(uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
for (uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
{
|
||||
if(mask & 1)
|
||||
{
|
||||
@@ -1510,7 +1510,7 @@ uint32 ObjectMgr::AddCreData(uint32 entry, uint32 team, uint32 mapId, float x, f
|
||||
}
|
||||
}
|
||||
|
||||
return guid;
|
||||
return guid;
|
||||
}
|
||||
|
||||
void ObjectMgr::LoadGameobjects()
|
||||
@@ -1632,7 +1632,7 @@ void ObjectMgr::LoadGameobjects()
|
||||
void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
|
||||
{
|
||||
uint8 mask = data->spawnMask;
|
||||
for(uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
for (uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
{
|
||||
if(mask & 1)
|
||||
{
|
||||
@@ -1648,7 +1648,7 @@ void ObjectMgr::AddGameobjectToGrid(uint32 guid, GameObjectData const* data)
|
||||
void ObjectMgr::RemoveGameobjectFromGrid(uint32 guid, GameObjectData const* data)
|
||||
{
|
||||
uint8 mask = data->spawnMask;
|
||||
for(uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
for (uint8 i = 0; mask != 0; i++, mask >>= 1)
|
||||
{
|
||||
if(mask & 1)
|
||||
{
|
||||
@@ -1857,7 +1857,7 @@ void ObjectMgr::LoadItemLocales()
|
||||
|
||||
ItemLocale& data = mItemLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[1+2*(i-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -1910,7 +1910,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
sLog.outString();
|
||||
|
||||
// check data correctness
|
||||
for(uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sItemStorage.MaxEntry; ++i)
|
||||
{
|
||||
ItemPrototype const* proto = sItemStorage.LookupEntry<ItemPrototype >(i);
|
||||
ItemEntry const *dbcitem = sItemStore.LookupEntry(i);
|
||||
@@ -2253,7 +2253,7 @@ void ObjectMgr::LoadItemPrototypes()
|
||||
if(proto->BagFamily)
|
||||
{
|
||||
// check bits
|
||||
for(uint32 j = 0; j < sizeof(proto->BagFamily)*8; ++j)
|
||||
for (uint32 j = 0; j < sizeof(proto->BagFamily)*8; ++j)
|
||||
{
|
||||
uint32 mask = 1 << j;
|
||||
if((proto->BagFamily & mask)==0)
|
||||
@@ -2354,7 +2354,7 @@ void ObjectMgr::LoadItemRequiredTarget()
|
||||
|
||||
bool bIsItemSpellValid = false;
|
||||
|
||||
for(uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
for (uint8 i = 0; i < MAX_ITEM_PROTO_SPELLS; ++i)
|
||||
{
|
||||
if (SpellEntry const* pSpellInfo = sSpellStore.LookupEntry(pItemProto->Spells[i].SpellId))
|
||||
{
|
||||
@@ -2741,8 +2741,8 @@ void ObjectMgr::LoadPlayerInfo()
|
||||
uint32 max_race = current_race ? current_race + 1 : MAX_RACES;
|
||||
uint32 min_class = current_class ? current_class : 1;
|
||||
uint32 max_class = current_class ? current_class + 1 : MAX_CLASSES;
|
||||
for(uint32 r = min_race; r < max_race; ++r)
|
||||
for(uint32 c = min_class; c < max_class; ++c)
|
||||
for (uint32 r = min_race; r < max_race; ++r)
|
||||
for (uint32 c = min_class; c < max_class; ++c)
|
||||
playerInfo[r][c].spell.push_back(fields[2].GetUInt32());
|
||||
}
|
||||
else
|
||||
@@ -3121,7 +3121,7 @@ void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, Play
|
||||
*info = playerInfo[race][_class].levelInfo[sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1];
|
||||
|
||||
// if conversion from uint32 to uint8 causes unexpected behaviour, change lvl to uint32
|
||||
for(uint8 lvl = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
|
||||
for (uint8 lvl = sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL)-1; lvl < level; ++lvl)
|
||||
{
|
||||
switch(_class)
|
||||
{
|
||||
@@ -3369,7 +3369,7 @@ void ObjectMgr::LoadGroups()
|
||||
|
||||
// clean groups
|
||||
// TODO: maybe delete from the DB before loading in this case
|
||||
for(GroupSet::iterator itr = mGroupSet.begin(); itr != mGroupSet.end();)
|
||||
for (GroupSet::iterator itr = mGroupSet.begin(); itr != mGroupSet.end(); )
|
||||
{
|
||||
if((*itr)->GetMembersCount() < 2)
|
||||
{
|
||||
@@ -3440,7 +3440,7 @@ void ObjectMgr::LoadGroups()
|
||||
void ObjectMgr::LoadQuests()
|
||||
{
|
||||
// For reload case
|
||||
for(QuestMap::const_iterator itr=mQuestTemplates.begin(); itr != mQuestTemplates.end(); ++itr)
|
||||
for (QuestMap::const_iterator itr=mQuestTemplates.begin(); itr != mQuestTemplates.end(); ++itr)
|
||||
delete itr->second;
|
||||
mQuestTemplates.clear();
|
||||
|
||||
@@ -3538,7 +3538,7 @@ void ObjectMgr::LoadQuests()
|
||||
if(qinfo->QuestFlags & QUEST_FLAGS_AUTO_REWARDED)
|
||||
{
|
||||
// at auto-reward can be rewarded only RewChoiceItemId[0]
|
||||
for(uint8 j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
for (uint8 j = 1; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
{
|
||||
if(uint32 id = qinfo->RewChoiceItemId[j])
|
||||
{
|
||||
@@ -3732,7 +3732,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
{
|
||||
uint32 id = qinfo->ReqItemId[j];
|
||||
if(id)
|
||||
@@ -3761,7 +3761,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_SOURCE_ITEM_IDS_COUNT; ++j )
|
||||
{
|
||||
uint32 id = qinfo->ReqSourceId[j];
|
||||
if(id)
|
||||
@@ -3784,7 +3784,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
{
|
||||
uint32 id = qinfo->ReqSpell[j];
|
||||
if(id)
|
||||
@@ -3800,7 +3800,7 @@ void ObjectMgr::LoadQuests()
|
||||
if(!qinfo->ReqCreatureOrGOId[j])
|
||||
{
|
||||
bool found = false;
|
||||
for(uint8 k = 0; k < 3; ++k)
|
||||
for (uint8 k = 0; k < 3; ++k)
|
||||
{
|
||||
if ((spellInfo->Effect[k] == SPELL_EFFECT_QUEST_COMPLETE && uint32(spellInfo->EffectMiscValue[k]) == qinfo->QuestId) ||
|
||||
spellInfo->Effect[k] == SPELL_EFFECT_SEND_EVENT)
|
||||
@@ -3830,7 +3830,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_OBJECTIVES_COUNT; ++j )
|
||||
{
|
||||
int32 id = qinfo->ReqCreatureOrGOId[j];
|
||||
if(id < 0 && !sGOStorage.LookupEntry<GameObjectInfo>(-id))
|
||||
@@ -3868,7 +3868,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_REWARD_CHOICES_COUNT; ++j )
|
||||
{
|
||||
uint32 id = qinfo->RewChoiceItemId[j];
|
||||
if(id)
|
||||
@@ -3895,7 +3895,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j )
|
||||
for (uint8 j = 0; j < QUEST_REWARDS_COUNT; ++j )
|
||||
{
|
||||
uint32 id = qinfo->RewItemId[j];
|
||||
if(id)
|
||||
@@ -3922,7 +3922,7 @@ void ObjectMgr::LoadQuests()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 j = 0; j < QUEST_REPUTATIONS_COUNT; ++j)
|
||||
for (uint8 j = 0; j < QUEST_REPUTATIONS_COUNT; ++j)
|
||||
{
|
||||
if(qinfo->RewRepFaction[j])
|
||||
{
|
||||
@@ -4064,7 +4064,7 @@ void ObjectMgr::LoadQuests()
|
||||
if(!spellInfo)
|
||||
continue;
|
||||
|
||||
for(uint8 j = 0; j < 3; ++j)
|
||||
for (uint8 j = 0; j < 3; ++j)
|
||||
{
|
||||
if(spellInfo->Effect[j] != SPELL_EFFECT_QUEST_COMPLETE)
|
||||
continue;
|
||||
@@ -4129,7 +4129,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||
|
||||
QuestLocale& data = mQuestLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[1+10*(i-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -4203,7 +4203,7 @@ void ObjectMgr::LoadQuestLocales()
|
||||
data.EndText[idx] = str;
|
||||
}
|
||||
}
|
||||
for(uint8 k = 0; k < 4; ++k)
|
||||
for (uint8 k = 0; k < 4; ++k)
|
||||
{
|
||||
str = fields[1+10*(i-1)+6+k].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -4486,7 +4486,7 @@ void ObjectMgr::LoadGameObjectScripts()
|
||||
LoadScripts(sGameObjectScripts, "gameobject_scripts");
|
||||
|
||||
// check ids
|
||||
for(ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sGameObjectScripts.begin(); itr != sGameObjectScripts.end(); ++itr)
|
||||
{
|
||||
if(!GetGOData(itr->first))
|
||||
sLog.outErrorDb("Table `gameobject_scripts` has not existing gameobject (GUID: %u) as script id",itr->first);
|
||||
@@ -4498,7 +4498,7 @@ void ObjectMgr::LoadQuestEndScripts()
|
||||
LoadScripts(sQuestEndScripts, "quest_end_scripts");
|
||||
|
||||
// check ids
|
||||
for(ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sQuestEndScripts.begin(); itr != sQuestEndScripts.end(); ++itr)
|
||||
{
|
||||
if(!GetQuestTemplate(itr->first))
|
||||
sLog.outErrorDb("Table `quest_end_scripts` has not existing quest (Id: %u) as script id",itr->first);
|
||||
@@ -4510,7 +4510,7 @@ void ObjectMgr::LoadQuestStartScripts()
|
||||
LoadScripts(sQuestStartScripts,"quest_start_scripts");
|
||||
|
||||
// check ids
|
||||
for(ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sQuestStartScripts.begin(); itr != sQuestStartScripts.end(); ++itr)
|
||||
{
|
||||
if(!GetQuestTemplate(itr->first))
|
||||
sLog.outErrorDb("Table `quest_start_scripts` has not existing quest (Id: %u) as script id",itr->first);
|
||||
@@ -4522,7 +4522,7 @@ void ObjectMgr::LoadSpellScripts()
|
||||
LoadScripts(sSpellScripts, "spell_scripts");
|
||||
|
||||
// check ids
|
||||
for(ScriptMapMap::const_iterator itr = sSpellScripts.begin(); itr != sSpellScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sSpellScripts.begin(); itr != sSpellScripts.end(); ++itr)
|
||||
{
|
||||
SpellEntry const* spellInfo = sSpellStore.LookupEntry(itr->first);
|
||||
|
||||
@@ -4534,7 +4534,7 @@ void ObjectMgr::LoadSpellScripts()
|
||||
|
||||
//check for correct spellEffect
|
||||
bool found = false;
|
||||
for(uint8 i=0; i<3; ++i)
|
||||
for (uint8 i=0; i<3; ++i)
|
||||
{
|
||||
// skip empty effects
|
||||
if( !spellInfo->Effect[i] )
|
||||
@@ -4558,7 +4558,7 @@ void ObjectMgr::LoadEventScripts()
|
||||
|
||||
std::set<uint32> evt_scripts;
|
||||
// Load all possible script entries from gameobjects
|
||||
for(uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sGOStorage.MaxEntry; ++i)
|
||||
{
|
||||
GameObjectInfo const * goInfo = sGOStorage.LookupEntry<GameObjectInfo>(i);
|
||||
if (goInfo)
|
||||
@@ -4582,12 +4582,12 @@ void ObjectMgr::LoadEventScripts()
|
||||
}
|
||||
}
|
||||
// Load all possible script entries from spells
|
||||
for(uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sSpellStore.GetNumRows(); ++i)
|
||||
{
|
||||
SpellEntry const * spell = sSpellStore.LookupEntry(i);
|
||||
if (spell)
|
||||
{
|
||||
for(uint8 j=0; j<3; ++j)
|
||||
for (uint8 j=0; j<3; ++j)
|
||||
{
|
||||
if( spell->Effect[j] == SPELL_EFFECT_SEND_EVENT )
|
||||
{
|
||||
@@ -4598,7 +4598,7 @@ void ObjectMgr::LoadEventScripts()
|
||||
}
|
||||
}
|
||||
// Then check if all scripts are in above list of possible script entries
|
||||
for(ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sEventScripts.begin(); itr != sEventScripts.end(); ++itr)
|
||||
{
|
||||
std::set<uint32>::const_iterator itr2 = evt_scripts.find(itr->first);
|
||||
if (itr2 == evt_scripts.end())
|
||||
@@ -4612,7 +4612,7 @@ void ObjectMgr::LoadWaypointScripts()
|
||||
{
|
||||
LoadScripts(sWaypointScripts, "waypoint_scripts");
|
||||
|
||||
for(ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr)
|
||||
for (ScriptMapMap::const_iterator itr = sWaypointScripts.begin(); itr != sWaypointScripts.end(); ++itr)
|
||||
{
|
||||
QueryResult *query = WorldDatabase.PQuery("SELECT * FROM waypoint_scripts WHERE id = %u", itr->first);
|
||||
if(!query || !query->GetRowCount())
|
||||
@@ -4665,7 +4665,7 @@ void ObjectMgr::LoadPageTexts()
|
||||
sLog.outString( ">> Loaded %u page texts", sPageTextStore.RecordCount );
|
||||
sLog.outString();
|
||||
|
||||
for(uint32 i = 1; i < sPageTextStore.MaxEntry; ++i)
|
||||
for (uint32 i = 1; i < sPageTextStore.MaxEntry; ++i)
|
||||
{
|
||||
// check data correctness
|
||||
PageText const* page = sPageTextStore.LookupEntry<PageText>(i);
|
||||
@@ -4680,7 +4680,7 @@ void ObjectMgr::LoadPageTexts()
|
||||
|
||||
// detect circular reference
|
||||
std::set<uint32> checkedPages;
|
||||
for(PageText const* pageItr = page; pageItr; pageItr = sPageTextStore.LookupEntry<PageText>(pageItr->Next_Page))
|
||||
for (PageText const* pageItr = page; pageItr; pageItr = sPageTextStore.LookupEntry<PageText>(pageItr->Next_Page))
|
||||
{
|
||||
if(!pageItr->Next_Page)
|
||||
break;
|
||||
@@ -4689,7 +4689,7 @@ void ObjectMgr::LoadPageTexts()
|
||||
{
|
||||
std::ostringstream ss;
|
||||
ss<< "The text page(s) ";
|
||||
for (std::set<uint32>::iterator itr= checkedPages.begin();itr!=checkedPages.end(); ++itr)
|
||||
for (std::set<uint32>::iterator itr= checkedPages.begin(); itr!=checkedPages.end(); ++itr)
|
||||
ss << *itr << " ";
|
||||
ss << "create(s) a circular reference, which can cause the server to freeze. Changing Next_Page of page "
|
||||
<< pageItr->Page_ID <<" to 0";
|
||||
@@ -4729,7 +4729,7 @@ void ObjectMgr::LoadPageTextLocales()
|
||||
|
||||
PageTextLocale& data = mPageTextLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i].GetCppString();
|
||||
if(str.empty())
|
||||
@@ -4767,7 +4767,7 @@ void ObjectMgr::LoadInstanceTemplate()
|
||||
SQLInstanceLoader loader;
|
||||
loader.Load(sInstanceTemplate);
|
||||
|
||||
for(uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
|
||||
for (uint32 i = 0; i < sInstanceTemplate.MaxEntry; i++)
|
||||
{
|
||||
InstanceTemplate* temp = (InstanceTemplate*)GetInstanceTemplate(i);
|
||||
if(!temp) continue;
|
||||
@@ -4860,7 +4860,7 @@ void ObjectMgr::LoadGossipText()
|
||||
gText.Options[i].Language = fields[cic++].GetUInt32();
|
||||
gText.Options[i].Probability = fields[cic++].GetFloat();
|
||||
|
||||
for(uint8 j=0; j < 3; ++j)
|
||||
for (uint8 j=0; j < 3; ++j)
|
||||
{
|
||||
gText.Options[i].Emotes[j]._Delay = fields[cic++].GetUInt32();
|
||||
gText.Options[i].Emotes[j]._Emote = fields[cic++].GetUInt32();
|
||||
@@ -4910,9 +4910,9 @@ void ObjectMgr::LoadNpcTextLocales()
|
||||
|
||||
NpcTextLocale& data = mNpcTextLocaleMap[entry];
|
||||
|
||||
for(uint8 i=1; i<MAX_LOCALE; ++i)
|
||||
for (uint8 i=1; i<MAX_LOCALE; ++i)
|
||||
{
|
||||
for(uint8 j=0; j<8; ++j)
|
||||
for (uint8 j=0; j<8; ++j)
|
||||
{
|
||||
std::string str0 = fields[1+8*2*(i-1)+2*j].GetCppString();
|
||||
if(!str0.empty())
|
||||
@@ -5026,7 +5026,7 @@ void ObjectMgr::ReturnOrDeleteOldMails(bool serverUp)
|
||||
if (m->messageType != MAIL_NORMAL || (m->checked & (MAIL_CHECK_MASK_AUCTION | MAIL_CHECK_MASK_COD_PAYMENT | MAIL_CHECK_MASK_RETURNED)))
|
||||
{
|
||||
// mail open and then not returned
|
||||
for(std::vector<MailItemInfo>::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
|
||||
for (std::vector<MailItemInfo>::iterator itr2 = m->items.begin(); itr2 != m->items.end(); ++itr2)
|
||||
CharacterDatabase.PExecute("DELETE FROM item_instance WHERE guid = '%u'", itr2->item_guid);
|
||||
}
|
||||
else
|
||||
@@ -5213,7 +5213,7 @@ uint32 ObjectMgr::GetNearestTaxiNode( float x, float y, float z, uint32 mapid, u
|
||||
float dist;
|
||||
uint32 id = 0;
|
||||
|
||||
for(uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
for (uint32 i = 1; i < sTaxiNodesStore.GetNumRows(); ++i)
|
||||
{
|
||||
TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(i);
|
||||
if(!node || node->map_id != mapid || !node->MountCreatureID[team == ALLIANCE ? 1 : 0] && node->MountCreatureID[0] != 32981) // dk flight
|
||||
@@ -5321,7 +5321,7 @@ void ObjectMgr::GetTaxiPathNodes( uint32 path, Path &pathnodes, std::vector<uint
|
||||
pathnodes.Resize(nodeList.size());
|
||||
mapIds.resize(nodeList.size());
|
||||
|
||||
for(size_t i = 0; i < nodeList.size(); ++i)
|
||||
for (size_t i = 0; i < nodeList.size(); ++i)
|
||||
{
|
||||
pathnodes[ i ].x = nodeList[i].x;
|
||||
pathnodes[ i ].y = nodeList[i].y;
|
||||
@@ -5340,7 +5340,7 @@ void ObjectMgr::GetTransportPathNodes( uint32 path, TransportPath &pathnodes )
|
||||
|
||||
pathnodes.Resize(nodeList.size());
|
||||
|
||||
for(size_t i = 0; i < nodeList.size(); ++i)
|
||||
for (size_t i = 0; i < nodeList.size(); ++i)
|
||||
{
|
||||
pathnodes[ i ].mapid = nodeList[i].mapid;
|
||||
pathnodes[ i ].x = nodeList[i].x;
|
||||
@@ -5456,7 +5456,7 @@ WorldSafeLocsEntry const *ObjectMgr::GetClosestGraveYard(float x, float y, float
|
||||
|
||||
MapEntry const* mapEntry = sMapStore.LookupEntry(MapId);
|
||||
|
||||
for(GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||
for (GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||
{
|
||||
GraveYardData const& data = itr->second;
|
||||
|
||||
@@ -5539,7 +5539,7 @@ GraveYardData const* ObjectMgr::FindGraveYardData(uint32 id, uint32 zoneId)
|
||||
GraveYardMap::const_iterator graveLow = mGraveYardMap.lower_bound(zoneId);
|
||||
GraveYardMap::const_iterator graveUp = mGraveYardMap.upper_bound(zoneId);
|
||||
|
||||
for(GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||
for (GraveYardMap::const_iterator itr = graveLow; itr != graveUp; ++itr)
|
||||
{
|
||||
if(itr->second.safeLocId==id)
|
||||
return &itr->second;
|
||||
@@ -5584,7 +5584,7 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
|
||||
|
||||
GraveYardMap::iterator itr;
|
||||
|
||||
for(itr = graveLow; itr != graveUp; ++itr)
|
||||
for (itr = graveLow; itr != graveUp; ++itr)
|
||||
{
|
||||
GraveYardData & data = itr->second;
|
||||
|
||||
@@ -5617,7 +5617,6 @@ void ObjectMgr::RemoveGraveYardLink(uint32 id, uint32 zoneId, uint32 team, bool
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
void ObjectMgr::LoadAreaTriggerTeleports()
|
||||
{
|
||||
mAreaTriggers.clear(); // need for reload case
|
||||
@@ -6100,7 +6099,7 @@ void ObjectMgr::LoadGameObjectLocales()
|
||||
|
||||
GameObjectLocale& data = mGameObjectLocaleMap[entry];
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -6116,7 +6115,7 @@ void ObjectMgr::LoadGameObjectLocales()
|
||||
}
|
||||
}
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i+(MAX_LOCALE-1)].GetCppString();
|
||||
if(!str.empty())
|
||||
@@ -6220,7 +6219,7 @@ void ObjectMgr::LoadGameobjectInfo()
|
||||
loader.Load(sGOStorage);
|
||||
|
||||
// some checks
|
||||
for(uint32 id = 1; id < sGOStorage.MaxEntry; id++)
|
||||
for (uint32 id = 1; id < sGOStorage.MaxEntry; id++)
|
||||
{
|
||||
GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(id);
|
||||
if (!goInfo)
|
||||
@@ -6826,7 +6825,7 @@ void ObjectMgr::LoadWeatherZoneChances()
|
||||
|
||||
WeatherZoneChances& wzc = mWeatherZoneMap[zone_id];
|
||||
|
||||
for(uint8 season = 0; season < WEATHER_SEASONS; ++season)
|
||||
for (uint8 season = 0; season < WEATHER_SEASONS; ++season)
|
||||
{
|
||||
wzc.data[season].rainChance = fields[season * (MAX_WEATHER_TYPE-1) + 1].GetUInt32();
|
||||
wzc.data[season].snowChance = fields[season * (MAX_WEATHER_TYPE-1) + 2].GetUInt32();
|
||||
@@ -6890,7 +6889,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance)
|
||||
{
|
||||
RespawnTimes::iterator next;
|
||||
|
||||
for(RespawnTimes::iterator itr = mGORespawnTimes.begin(); itr != mGORespawnTimes.end(); itr = next)
|
||||
for (RespawnTimes::iterator itr = mGORespawnTimes.begin(); itr != mGORespawnTimes.end(); itr = next)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
@@ -6899,7 +6898,7 @@ void ObjectMgr::DeleteRespawnTimeForInstance(uint32 instance)
|
||||
mGORespawnTimes.erase(itr);
|
||||
}
|
||||
|
||||
for(RespawnTimes::iterator itr = mCreatureRespawnTimes.begin(); itr != mCreatureRespawnTimes.end(); itr = next)
|
||||
for (RespawnTimes::iterator itr = mCreatureRespawnTimes.begin(); itr != mCreatureRespawnTimes.end(); itr = next)
|
||||
{
|
||||
next = itr;
|
||||
++next;
|
||||
@@ -6986,7 +6985,7 @@ void ObjectMgr::LoadGameobjectQuestRelations()
|
||||
{
|
||||
LoadQuestRelationsHelper(mGOQuestRelations,"gameobject_questrelation");
|
||||
|
||||
for(QuestRelations::iterator itr = mGOQuestRelations.begin(); itr != mGOQuestRelations.end(); ++itr)
|
||||
for (QuestRelations::iterator itr = mGOQuestRelations.begin(); itr != mGOQuestRelations.end(); ++itr)
|
||||
{
|
||||
GameObjectInfo const* goInfo = GetGameObjectInfo(itr->first);
|
||||
if(!goInfo)
|
||||
@@ -7000,7 +6999,7 @@ void ObjectMgr::LoadGameobjectInvolvedRelations()
|
||||
{
|
||||
LoadQuestRelationsHelper(mGOQuestInvolvedRelations,"gameobject_involvedrelation");
|
||||
|
||||
for(QuestRelations::iterator itr = mGOQuestInvolvedRelations.begin(); itr != mGOQuestInvolvedRelations.end(); ++itr)
|
||||
for (QuestRelations::iterator itr = mGOQuestInvolvedRelations.begin(); itr != mGOQuestInvolvedRelations.end(); ++itr)
|
||||
{
|
||||
GameObjectInfo const* goInfo = GetGameObjectInfo(itr->first);
|
||||
if(!goInfo)
|
||||
@@ -7014,7 +7013,7 @@ void ObjectMgr::LoadCreatureQuestRelations()
|
||||
{
|
||||
LoadQuestRelationsHelper(mCreatureQuestRelations,"creature_questrelation");
|
||||
|
||||
for(QuestRelations::iterator itr = mCreatureQuestRelations.begin(); itr != mCreatureQuestRelations.end(); ++itr)
|
||||
for (QuestRelations::iterator itr = mCreatureQuestRelations.begin(); itr != mCreatureQuestRelations.end(); ++itr)
|
||||
{
|
||||
CreatureInfo const* cInfo = GetCreatureTemplate(itr->first);
|
||||
if(!cInfo)
|
||||
@@ -7028,7 +7027,7 @@ void ObjectMgr::LoadCreatureInvolvedRelations()
|
||||
{
|
||||
LoadQuestRelationsHelper(mCreatureQuestInvolvedRelations,"creature_involvedrelation");
|
||||
|
||||
for(QuestRelations::iterator itr = mCreatureQuestInvolvedRelations.begin(); itr != mCreatureQuestInvolvedRelations.end(); ++itr)
|
||||
for (QuestRelations::iterator itr = mCreatureQuestInvolvedRelations.begin(); itr != mCreatureQuestInvolvedRelations.end(); ++itr)
|
||||
{
|
||||
CreatureInfo const* cInfo = GetCreatureTemplate(itr->first);
|
||||
if(!cInfo)
|
||||
@@ -7231,7 +7230,7 @@ int ObjectMgr::GetIndexForLocale( LocaleConstant loc )
|
||||
if(loc==LOCALE_enUS)
|
||||
return -1;
|
||||
|
||||
for(size_t i=0;i < m_LocalForIndex.size(); ++i)
|
||||
for (size_t i=0; i < m_LocalForIndex.size(); ++i)
|
||||
if(m_LocalForIndex[i]==loc)
|
||||
return i;
|
||||
|
||||
@@ -7251,7 +7250,7 @@ int ObjectMgr::GetOrNewIndexForLocale( LocaleConstant loc )
|
||||
if(loc==LOCALE_enUS)
|
||||
return -1;
|
||||
|
||||
for(size_t i=0;i < m_LocalForIndex.size(); ++i)
|
||||
for (size_t i=0; i < m_LocalForIndex.size(); ++i)
|
||||
if(m_LocalForIndex[i]==loc)
|
||||
return i;
|
||||
|
||||
@@ -7276,7 +7275,7 @@ void ObjectMgr::LoadGameObjectForQuests()
|
||||
uint32 count = 0;
|
||||
|
||||
// collect GO entries for GO that must activated
|
||||
for(uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry)
|
||||
for (uint32 go_entry = 1; go_entry < sGOStorage.MaxEntry; ++go_entry)
|
||||
{
|
||||
bar.step();
|
||||
GameObjectInfo const* goInfo = sGOStorage.LookupEntry<GameObjectInfo>(go_entry);
|
||||
@@ -7344,7 +7343,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi
|
||||
}
|
||||
|
||||
// cleanup affected map part for reloading case
|
||||
for(TrinityStringLocaleMap::iterator itr = mTrinityStringLocaleMap.begin(); itr != mTrinityStringLocaleMap.end();)
|
||||
for (TrinityStringLocaleMap::iterator itr = mTrinityStringLocaleMap.begin(); itr != mTrinityStringLocaleMap.end(); )
|
||||
{
|
||||
if (itr->first >= start_value && itr->first < end_value)
|
||||
mTrinityStringLocaleMap.erase(itr++);
|
||||
@@ -7404,7 +7403,7 @@ bool ObjectMgr::LoadTrinityStrings(DatabaseType& db, char const* table, int32 mi
|
||||
// 0 -> default, idx in to idx+1
|
||||
data.Content[0] = fields[1].GetCppString();
|
||||
|
||||
for(uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
for (uint8 i = 1; i < MAX_LOCALE; ++i)
|
||||
{
|
||||
std::string str = fields[i+1].GetCppString();
|
||||
if (!str.empty())
|
||||
@@ -7570,7 +7569,7 @@ uint16 ObjectMgr::GetConditionId( ConditionType condition, uint32 value1, uint32
|
||||
|
||||
bool ObjectMgr::CheckDeclinedNames( std::wstring mainpart, DeclinedName const& names )
|
||||
{
|
||||
for(uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
for (uint8 i =0; i < MAX_DECLINED_NAME_CASES; ++i)
|
||||
{
|
||||
std::wstring wname;
|
||||
if(!Utf8toWStr(names.name[i],wname))
|
||||
@@ -7627,7 +7626,7 @@ bool PlayerCondition::Meets(Player const * player) const
|
||||
case CONDITION_AD_COMMISSION_AURA:
|
||||
{
|
||||
Unit::AuraMap const& auras = player->GetAuras();
|
||||
for(Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
for (Unit::AuraMap::const_iterator itr = auras.begin(); itr != auras.end(); ++itr)
|
||||
if((itr->second->GetSpellProto()->Attributes & 0x1000010) && itr->second->GetSpellProto()->SpellVisual[0]==3580)
|
||||
return true;
|
||||
return false;
|
||||
@@ -7901,7 +7900,7 @@ GameTele const* ObjectMgr::GetGameTele(const std::string& name) const
|
||||
|
||||
// Alternative first GameTele what contains wnameLow as substring in case no GameTele location found
|
||||
const GameTele* alt = NULL;
|
||||
for(GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
for (GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
{
|
||||
if(itr->second.wnameLow == wname)
|
||||
return &itr->second;
|
||||
@@ -7916,7 +7915,7 @@ bool ObjectMgr::AddGameTele(GameTele& tele)
|
||||
{
|
||||
// find max id
|
||||
uint32 new_id = 0;
|
||||
for(GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
for (GameTeleMap::const_iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
if(itr->first > new_id)
|
||||
new_id = itr->first;
|
||||
|
||||
@@ -7944,7 +7943,7 @@ bool ObjectMgr::DeleteGameTele(const std::string& name)
|
||||
// converting string that we try to find to lower case
|
||||
wstrToLower( wname );
|
||||
|
||||
for(GameTeleMap::iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
for (GameTeleMap::iterator itr = m_GameTeleMap.begin(); itr != m_GameTeleMap.end(); ++itr)
|
||||
{
|
||||
if(itr->second.wnameLow == wname)
|
||||
{
|
||||
@@ -8048,7 +8047,7 @@ void ObjectMgr::LoadTrainerSpell()
|
||||
|
||||
// calculate learned spell for profession case when stored cast-spell
|
||||
trainerSpell.learnedSpell = spell;
|
||||
for(uint8 i = 0; i <3; ++i)
|
||||
for (uint8 i = 0; i <3; ++i)
|
||||
{
|
||||
if(spellinfo->Effect[i] != SPELL_EFFECT_LEARN_SPELL)
|
||||
continue;
|
||||
@@ -8388,9 +8387,9 @@ uint32 ObjectMgr::GetScriptId(const char *name)
|
||||
|
||||
void ObjectMgr::CheckScripts(ScriptMapMap const& scripts,std::set<int32>& ids)
|
||||
{
|
||||
for(ScriptMapMap::const_iterator itrMM = scripts.begin(); itrMM != scripts.end(); ++itrMM)
|
||||
for (ScriptMapMap::const_iterator itrMM = scripts.begin(); itrMM != scripts.end(); ++itrMM)
|
||||
{
|
||||
for(ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
|
||||
for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
|
||||
{
|
||||
switch(itrM->second.command)
|
||||
{
|
||||
@@ -8413,7 +8412,7 @@ void ObjectMgr::LoadDbScriptStrings()
|
||||
|
||||
std::set<int32> ids;
|
||||
|
||||
for(int32 i = MIN_DB_SCRIPT_STRING_ID; i < MAX_DB_SCRIPT_STRING_ID; ++i)
|
||||
for (int32 i = MIN_DB_SCRIPT_STRING_ID; i < MAX_DB_SCRIPT_STRING_ID; ++i)
|
||||
if(GetTrinityStringLocale(i))
|
||||
ids.insert(i);
|
||||
|
||||
@@ -8425,7 +8424,7 @@ void ObjectMgr::LoadDbScriptStrings()
|
||||
|
||||
CheckScripts(sWaypointScripts,ids);
|
||||
|
||||
for(std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
|
||||
for (std::set<int32>::const_iterator itr = ids.begin(); itr != ids.end(); ++itr)
|
||||
sLog.outErrorDb( "Table `db_script_string` has unused string id %u", *itr);
|
||||
}
|
||||
|
||||
@@ -8522,9 +8521,9 @@ uint64 ObjectMgr::GenerateGMTicketId()
|
||||
void ObjectMgr::LoadGMTickets()
|
||||
{
|
||||
m_GMTicketList.clear();
|
||||
|
||||
|
||||
QueryResult *result = CharacterDatabase.Query( "SELECT guid, playerGuid, name, message, createtime, map, posX, posY, posZ, timestamp, closed, assignedto, comment FROM gm_tickets" );
|
||||
|
||||
|
||||
if(!result)
|
||||
{
|
||||
sLog.outString(" \n>> GM Tickets table is empty, no tickets were loaded.\n" );
|
||||
@@ -8559,7 +8558,7 @@ void ObjectMgr::LoadGMTickets()
|
||||
} while( result->NextRow() );
|
||||
|
||||
result = CharacterDatabase.PQuery("SELECT MAX(guid) from gm_tickets");
|
||||
m_GMticketid = (*result)[0].GetUInt64();
|
||||
m_GMticketid = (*result)[0].GetUInt64();
|
||||
|
||||
sLog.outString(">>> %u GM Tickets loaded from the database.", count);
|
||||
delete result;
|
||||
@@ -8569,13 +8568,13 @@ void ObjectMgr::AddOrUpdateGMTicket(GM_Ticket &ticket, bool create)
|
||||
{
|
||||
if(create)
|
||||
m_GMTicketList.push_back(&ticket);
|
||||
|
||||
_AddOrUpdateGMTicket(ticket);
|
||||
|
||||
_AddOrUpdateGMTicket(ticket);
|
||||
}
|
||||
|
||||
void ObjectMgr::_AddOrUpdateGMTicket(GM_Ticket &ticket)
|
||||
{
|
||||
std::string msg(ticket.message), name(ticket.name), comment(ticket.comment);
|
||||
std::string msg(ticket.message), name(ticket.name), comment(ticket.comment);
|
||||
CharacterDatabase.escape_string(msg);
|
||||
CharacterDatabase.escape_string(name);
|
||||
CharacterDatabase.escape_string(comment);
|
||||
@@ -8601,7 +8600,7 @@ void ObjectMgr::_AddOrUpdateGMTicket(GM_Ticket &ticket)
|
||||
|
||||
void ObjectMgr::RemoveGMTicket(GM_Ticket *ticket, int64 source, bool permanently)
|
||||
{
|
||||
for(GmTicketList::iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
for (GmTicketList::iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
if((*i)->guid == ticket->guid)
|
||||
{
|
||||
if(permanently)
|
||||
|
||||
@@ -140,7 +140,6 @@ typedef UNORDERED_MAP<uint32/*(mapid,spawnMode) pair*/,CellObjectGuidsMap> MapOb
|
||||
|
||||
typedef UNORDERED_MAP<uint64/*(instance,guid) pair*/,time_t> RespawnTimes;
|
||||
|
||||
|
||||
// mangos string ranges
|
||||
#define MIN_TRINITY_STRING_ID 1 // 'mangos_string'
|
||||
#define MAX_TRINITY_STRING_ID 2000000000
|
||||
@@ -173,7 +172,7 @@ typedef std::pair<ItemRequiredTargetMap::const_iterator, ItemRequiredTargetMap::
|
||||
|
||||
struct PetLevelInfo
|
||||
{
|
||||
PetLevelInfo() : health(0), mana(0) { for(uint8 i=0; i < MAX_STATS; ++i ) stats[i] = 0; }
|
||||
PetLevelInfo() : health(0), mana(0) { for (uint8 i=0; i < MAX_STATS; ++i ) stats[i] = 0; }
|
||||
|
||||
uint16 stats[MAX_STATS];
|
||||
uint16 health;
|
||||
@@ -847,24 +846,24 @@ class ObjectMgr
|
||||
{
|
||||
return ItemRequiredTargetMapBounds(m_ItemRequiredTarget.lower_bound(uiItemEntry),m_ItemRequiredTarget.upper_bound(uiItemEntry));
|
||||
}
|
||||
|
||||
|
||||
GM_Ticket *GetGMTicket(uint64 ticketGuid)
|
||||
{
|
||||
for(GmTicketList::const_iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
for (GmTicketList::const_iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
if((*i) && (*i)->guid == ticketGuid)
|
||||
return (*i);
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
GM_Ticket *GetGMTicketByPlayer(uint64 playerGuid)
|
||||
{
|
||||
for(GmTicketList::const_iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
for (GmTicketList::const_iterator i = m_GMTicketList.begin(); i != m_GMTicketList.end(); ++i)
|
||||
if((*i) && (*i)->playerGuid == playerGuid && (*i)->closed == 0)
|
||||
return (*i);
|
||||
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
void AddOrUpdateGMTicket(GM_Ticket &ticket, bool create = false);
|
||||
void _AddOrUpdateGMTicket(GM_Ticket &ticket);
|
||||
void RemoveGMTicket(uint64 ticketGuid, int64 source = -1, bool permanently = false);
|
||||
|
||||
+24
-24
@@ -212,16 +212,16 @@ bool OPvPCapturePoint::DelCapturePoint()
|
||||
|
||||
void OPvPCapturePoint::DeleteSpawns()
|
||||
{
|
||||
for(std::map<uint32,uint64>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
|
||||
for (std::map<uint32,uint64>::iterator i = m_Objects.begin(); i != m_Objects.end(); ++i)
|
||||
DelObject(i->first);
|
||||
for(std::map<uint32,uint64>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
|
||||
for (std::map<uint32,uint64>::iterator i = m_Creatures.begin(); i != m_Creatures.end(); ++i)
|
||||
DelCreature(i->first);
|
||||
DelCapturePoint();
|
||||
}
|
||||
|
||||
void OutdoorPvP::DeleteSpawns()
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
itr->second->DeleteSpawns();
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ void OutdoorPvP::HandlePlayerEnterZone(Player * plr, uint32 zone)
|
||||
void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
{
|
||||
// inform the objectives of the leaving
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
itr->second->HandlePlayerLeave(plr);
|
||||
// remove the world state information from the player (we can't keep everyone up to date, so leave out those who are not in the concerning zones)
|
||||
if(!plr->GetSession()->PlayerLogout())
|
||||
@@ -254,7 +254,7 @@ void OutdoorPvP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
bool OutdoorPvP::Update(uint32 diff)
|
||||
{
|
||||
bool objective_changed = false;
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
{
|
||||
if(itr->second->Update(diff))
|
||||
objective_changed = true;
|
||||
@@ -269,9 +269,9 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
|
||||
float radius = m_capturePoint->GetGOInfo()->capturePoint.radius;
|
||||
|
||||
for(uint32 team = 0; team < 2; ++team)
|
||||
for (uint32 team = 0; team < 2; ++team)
|
||||
{
|
||||
for(PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end();)
|
||||
for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); )
|
||||
{
|
||||
Player *player = *itr;
|
||||
++itr;
|
||||
@@ -285,7 +285,7 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
Trinity::PlayerListSearcher<Trinity::AnyPlayerInObjectRangeCheck> searcher(m_capturePoint, players, checker);
|
||||
m_capturePoint->VisitNearbyWorldObject(radius, searcher);
|
||||
|
||||
for(std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
for (std::list<Player*>::iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
{
|
||||
if((*itr)->IsOutdoorPvPActive())
|
||||
{
|
||||
@@ -384,17 +384,17 @@ bool OPvPCapturePoint::Update(uint32 diff)
|
||||
void OutdoorPvP::SendUpdateWorldState(uint32 field, uint32 value)
|
||||
{
|
||||
if(m_sendUpdate)
|
||||
for(int i = 0; i < 2; ++i)
|
||||
for(PlayerSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
|
||||
for (int i = 0; i < 2; ++i)
|
||||
for (PlayerSet::iterator itr = m_players[i].begin(); itr != m_players[i].end(); ++itr)
|
||||
(*itr)->SendUpdateWorldState(field, value);
|
||||
}
|
||||
|
||||
void OPvPCapturePoint::SendUpdateWorldState(uint32 field, uint32 value)
|
||||
{
|
||||
for(uint32 team = 0; team < 2; ++team)
|
||||
for (uint32 team = 0; team < 2; ++team)
|
||||
{
|
||||
// send to all players present in the area
|
||||
for(PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
|
||||
{
|
||||
(*itr)->SendUpdateWorldState(field,value);
|
||||
}
|
||||
@@ -417,7 +417,7 @@ void OPvPCapturePoint::SendObjectiveComplete(uint32 id,uint64 guid)
|
||||
}
|
||||
|
||||
// send to all players present in the area
|
||||
for(PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_activePlayers[team].begin(); itr != m_activePlayers[team].end(); ++itr)
|
||||
(*itr)->KilledMonsterCredit(id, guid);
|
||||
}
|
||||
|
||||
@@ -425,7 +425,7 @@ void OutdoorPvP::HandleKill(Player *killer, Unit * killed)
|
||||
{
|
||||
if(Group * pGroup = killer->GetGroup())
|
||||
{
|
||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pGroupGuy = itr->getSource();
|
||||
|
||||
@@ -456,7 +456,7 @@ void OutdoorPvP::HandleKill(Player *killer, Unit * killed)
|
||||
|
||||
bool OutdoorPvP::IsInsideObjective(Player *plr) const
|
||||
{
|
||||
for(OPvPCapturePointMap::const_iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::const_iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->IsInsideObjective(plr))
|
||||
return true;
|
||||
|
||||
@@ -470,7 +470,7 @@ bool OPvPCapturePoint::IsInsideObjective(Player *plr) const
|
||||
|
||||
bool OutdoorPvP::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->HandleCustomSpell(plr,spellId,go))
|
||||
return true;
|
||||
|
||||
@@ -486,7 +486,7 @@ bool OPvPCapturePoint::HandleCustomSpell(Player *plr, uint32 spellId, GameObject
|
||||
|
||||
bool OutdoorPvP::HandleOpenGo(Player *plr, uint64 guid)
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->HandleOpenGo(plr,guid) >= 0)
|
||||
return true;
|
||||
|
||||
@@ -495,7 +495,7 @@ bool OutdoorPvP::HandleOpenGo(Player *plr, uint64 guid)
|
||||
|
||||
bool OutdoorPvP::HandleGossipOption(Player * plr, uint64 guid, uint32 id)
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->HandleGossipOption(plr, guid, id))
|
||||
return true;
|
||||
|
||||
@@ -504,7 +504,7 @@ bool OutdoorPvP::HandleGossipOption(Player * plr, uint64 guid, uint32 id)
|
||||
|
||||
bool OutdoorPvP::CanTalkTo(Player * plr, Creature * c, GossipOption &gso)
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->CanTalkTo(plr, c, gso))
|
||||
return true;
|
||||
|
||||
@@ -513,7 +513,7 @@ bool OutdoorPvP::CanTalkTo(Player * plr, Creature * c, GossipOption &gso)
|
||||
|
||||
bool OutdoorPvP::HandleDropFlag(Player * plr, uint32 id)
|
||||
{
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
if(itr->second->HandleDropFlag(plr, id))
|
||||
return true;
|
||||
|
||||
@@ -553,8 +553,8 @@ bool OutdoorPvP::HandleAreaTrigger(Player *plr, uint32 trigger)
|
||||
void OutdoorPvP::BroadcastPacket(WorldPacket &data) const
|
||||
{
|
||||
// This is faster than sWorld.SendZoneMessage
|
||||
for(uint32 team = 0; team < 2; ++team)
|
||||
for(PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
for (uint32 team = 0; team < 2; ++team)
|
||||
for (PlayerSet::const_iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
(*itr)->GetSession()->SendPacket(&data);
|
||||
}
|
||||
|
||||
@@ -571,10 +571,10 @@ bool OutdoorPvP::HasPlayer(Player *plr) const
|
||||
void OutdoorPvP::TeamCastSpell(TeamId team, int32 spellId)
|
||||
{
|
||||
if(spellId > 0)
|
||||
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
(*itr)->CastSpell(*itr, (uint32)spellId, true);
|
||||
else
|
||||
for(PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_players[team].begin(); itr != m_players[team].end(); ++itr)
|
||||
(*itr)->RemoveAura((uint32)-spellId); // by stack?
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -101,7 +101,6 @@ void OPvPCapturePointEP_EWT::ChangeState()
|
||||
flag2->SendUpdateObjectToAllExcept(NULL);
|
||||
}
|
||||
|
||||
|
||||
UpdateTowerState();
|
||||
|
||||
// complete quest objective
|
||||
@@ -173,7 +172,7 @@ void OPvPCapturePointEP_EWT::SummonSupportUnitAtNorthpassTower(uint32 team)
|
||||
else
|
||||
ct=EP_EWT_Summons_H;
|
||||
|
||||
for(int i = 0; i < EP_EWT_NUM_CREATURES; ++i)
|
||||
for (int i = 0; i < EP_EWT_NUM_CREATURES; ++i)
|
||||
{
|
||||
DelCreature(i);
|
||||
AddCreature(i,ct[i].entry,ct[i].teamval,ct[i].map,ct[i].x,ct[i].y,ct[i].z,ct[i].o,1000000);
|
||||
@@ -708,7 +707,7 @@ OutdoorPvPEP::OutdoorPvPEP()
|
||||
|
||||
bool OutdoorPvPEP::SetupOutdoorPvP()
|
||||
{
|
||||
for(int i = 0; i < EPBuffZonesNum; ++i)
|
||||
for (int i = 0; i < EPBuffZonesNum; ++i)
|
||||
RegisterZone(EPBuffZones[i]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointEP_EWT(this));
|
||||
@@ -724,7 +723,7 @@ bool OutdoorPvPEP::Update(uint32 diff)
|
||||
{
|
||||
m_AllianceTowersControlled = 0;
|
||||
m_HordeTowersControlled = 0;
|
||||
for(int i = 0; i < EP_TOWER_NUM; ++i)
|
||||
for (int i = 0; i < EP_TOWER_NUM; ++i)
|
||||
{
|
||||
if(EP_Controls[i] == ALLIANCE)
|
||||
++m_AllianceTowersControlled;
|
||||
@@ -760,12 +759,12 @@ void OutdoorPvPEP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
// remove buffs
|
||||
if(plr->GetTeam() == ALLIANCE)
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
}
|
||||
OutdoorPvP::HandlePlayerLeaveZone(plr, zone);
|
||||
@@ -773,21 +772,21 @@ void OutdoorPvPEP::HandlePlayerLeaveZone(Player * plr, uint32 zone)
|
||||
|
||||
void OutdoorPvPEP::BuffTeams()
|
||||
{
|
||||
for(PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_players[0].begin(); itr != m_players[0].end(); ++itr)
|
||||
{
|
||||
Player * plr = *itr;
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_AllianceBuffs[i]);
|
||||
if(m_AllianceTowersControlled && m_AllianceTowersControlled < 5)
|
||||
plr->CastSpell(plr,EP_AllianceBuffs[m_AllianceTowersControlled-1],true);
|
||||
}
|
||||
}
|
||||
for(PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
|
||||
for (PlayerSet::iterator itr = m_players[1].begin(); itr != m_players[1].end(); ++itr)
|
||||
{
|
||||
Player * plr = *itr;
|
||||
{
|
||||
for(int i = 0; i < 4; ++i)
|
||||
for (int i = 0; i < 4; ++i)
|
||||
plr->RemoveAurasDueToSpell(EP_HordeBuffs[i]);
|
||||
if(m_HordeTowersControlled && m_HordeTowersControlled < 5)
|
||||
plr->CastSpell(plr,EP_HordeBuffs[m_HordeTowersControlled-1],true);
|
||||
@@ -802,7 +801,7 @@ void OutdoorPvPEP::FillInitialWorldStates(WorldPacket & data)
|
||||
data << EP_UI_TOWER_SLIDER_DISPLAY << uint32(0);
|
||||
data << EP_UI_TOWER_SLIDER_POS << uint32(50);
|
||||
data << EP_UI_TOWER_SLIDER_N << uint32(100);
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
{
|
||||
itr->second->FillInitialWorldStates(data);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ bool OutdoorPvPHP::SetupOutdoorPvP()
|
||||
m_AllianceTowersControlled = 0;
|
||||
m_HordeTowersControlled = 0;
|
||||
// add the zones affected by the pvp buff
|
||||
for(int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
|
||||
for (int i = 0; i < OutdoorPvPHPBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPHPBuffZones[i]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointHP(this,HP_TOWER_BROKEN_HILL));
|
||||
@@ -140,7 +140,7 @@ void OutdoorPvPHP::SendRemoveWorldStates(Player *plr)
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_N,0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_POS,0);
|
||||
plr->SendUpdateWorldState(HP_UI_TOWER_SLIDER_DISPLAY,0);
|
||||
for(int i = 0; i < HP_TOWER_NUM; ++i)
|
||||
for (int i = 0; i < HP_TOWER_NUM; ++i)
|
||||
{
|
||||
plr->SendUpdateWorldState(HP_MAP_N[i],0);
|
||||
plr->SendUpdateWorldState(HP_MAP_A[i],0);
|
||||
@@ -157,7 +157,7 @@ void OutdoorPvPHP::FillInitialWorldStates(WorldPacket &data)
|
||||
data << uint32(HP_UI_TOWER_SLIDER_DISPLAY) << uint32(0);
|
||||
data << uint32(HP_UI_TOWER_SLIDER_POS) << uint32(50);
|
||||
data << uint32(HP_UI_TOWER_SLIDER_N) << uint32(100);
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
{
|
||||
itr->second->FillInitialWorldStates(data);
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ OutdoorPvPMgr::OutdoorPvPMgr()
|
||||
OutdoorPvPMgr::~OutdoorPvPMgr()
|
||||
{
|
||||
//sLog.outDebug("Deleting OutdoorPvPMgr");
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
(*itr)->DeleteSpawns();
|
||||
}
|
||||
@@ -60,7 +60,6 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
sLog.outDebug("OutdoorPvP : HP successfully initiated.");
|
||||
}
|
||||
|
||||
|
||||
pOP = new OutdoorPvPNA;
|
||||
// respawn, init variables
|
||||
if(!pOP->SetupOutdoorPvP())
|
||||
@@ -74,7 +73,6 @@ void OutdoorPvPMgr::InitOutdoorPvP()
|
||||
sLog.outDebug("OutdoorPvP : NA successfully initiated.");
|
||||
}
|
||||
|
||||
|
||||
pOP = new OutdoorPvPTF;
|
||||
// respawn, init variables
|
||||
if(!pOP->SetupOutdoorPvP())
|
||||
@@ -146,7 +144,6 @@ void OutdoorPvPMgr::AddZone(uint32 zoneid, OutdoorPvP *handle)
|
||||
m_OutdoorPvPMap[zoneid] = handle;
|
||||
}
|
||||
|
||||
|
||||
void OutdoorPvPMgr::HandlePlayerEnterZone(Player *plr, uint32 zoneid)
|
||||
{
|
||||
OutdoorPvPMap::iterator itr = m_OutdoorPvPMap.find(zoneid);
|
||||
@@ -190,7 +187,7 @@ void OutdoorPvPMgr::Update(uint32 diff)
|
||||
m_UpdateTimer += diff;
|
||||
if(m_UpdateTimer > OUTDOORPVP_OBJECTIVE_UPDATE_INTERVAL)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
(*itr)->Update(m_UpdateTimer);
|
||||
m_UpdateTimer = 0;
|
||||
}
|
||||
@@ -198,7 +195,7 @@ void OutdoorPvPMgr::Update(uint32 diff)
|
||||
|
||||
bool OutdoorPvPMgr::HandleCustomSpell(Player *plr, uint32 spellId, GameObject * go)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if((*itr)->HandleCustomSpell(plr,spellId,go))
|
||||
return true;
|
||||
@@ -217,7 +214,7 @@ ZoneScript * OutdoorPvPMgr::GetZoneScript(uint32 zoneId)
|
||||
|
||||
bool OutdoorPvPMgr::HandleOpenGo(Player *plr, uint64 guid)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if((*itr)->HandleOpenGo(plr,guid))
|
||||
return true;
|
||||
@@ -227,7 +224,7 @@ bool OutdoorPvPMgr::HandleOpenGo(Player *plr, uint64 guid)
|
||||
|
||||
void OutdoorPvPMgr::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if((*itr)->HandleGossipOption(plr,guid,gossipid))
|
||||
return;
|
||||
@@ -236,7 +233,7 @@ void OutdoorPvPMgr::HandleGossipOption(Player *plr, uint64 guid, uint32 gossipid
|
||||
|
||||
bool OutdoorPvPMgr::CanTalkTo(Player * plr, Creature * c, GossipOption & gso)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if((*itr)->CanTalkTo(plr,c,gso))
|
||||
return true;
|
||||
@@ -246,7 +243,7 @@ bool OutdoorPvPMgr::CanTalkTo(Player * plr, Creature * c, GossipOption & gso)
|
||||
|
||||
void OutdoorPvPMgr::HandleDropFlag(Player *plr, uint32 spellId)
|
||||
{
|
||||
for(OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
for (OutdoorPvPSet::iterator itr = m_OutdoorPvPSet.begin(); itr != m_OutdoorPvPSet.end(); ++itr)
|
||||
{
|
||||
if((*itr)->HandleDropFlag(plr,spellId))
|
||||
return;
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
bool HandleCustomSpell(Player * plr, uint32 spellId, GameObject* go);
|
||||
// handle custom go if registered
|
||||
bool HandleOpenGo(Player * plr, uint64 guid);
|
||||
|
||||
|
||||
ZoneScript * GetZoneScript(uint32 zoneId);
|
||||
|
||||
void AddZone(uint32 zoneid, OutdoorPvP * handle);
|
||||
|
||||
@@ -44,7 +44,7 @@ void OutdoorPvPNA::HandleKillImpl(Player *plr, Unit * killed)
|
||||
uint32 OPvPCapturePointNA::GetAliveGuardsCount()
|
||||
{
|
||||
uint32 cnt = 0;
|
||||
for(std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
|
||||
for (std::map<uint32, uint64>::iterator itr = m_Creatures.begin(); itr != m_Creatures.end(); ++itr)
|
||||
{
|
||||
switch(itr->first)
|
||||
{
|
||||
@@ -92,13 +92,13 @@ void OPvPCapturePointNA::SpawnNPCsForTeam(uint32 team)
|
||||
creatures=HordeControlNPCs;
|
||||
else
|
||||
return;
|
||||
for(int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
|
||||
for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
|
||||
AddCreature(i,creatures[i].entry,creatures[i].teamval,creatures[i].map,creatures[i].x,creatures[i].y,creatures[i].z,creatures[i].o,1000000);
|
||||
}
|
||||
|
||||
void OPvPCapturePointNA::DeSpawnNPCs()
|
||||
{
|
||||
for(int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
|
||||
for (int i = 0; i < NA_CONTROL_NPC_NUM; ++i)
|
||||
DelCreature(i);
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ void OPvPCapturePointNA::SpawnGOsForTeam(uint32 team)
|
||||
gos=HordeControlGOs;
|
||||
else
|
||||
return;
|
||||
for(int i = 0; i < NA_CONTROL_GO_NUM; ++i)
|
||||
for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
|
||||
{
|
||||
if( i == NA_ROOST_S ||
|
||||
i == NA_ROOST_W ||
|
||||
@@ -128,7 +128,7 @@ void OPvPCapturePointNA::SpawnGOsForTeam(uint32 team)
|
||||
|
||||
void OPvPCapturePointNA::DeSpawnGOs()
|
||||
{
|
||||
for(int i = 0; i < NA_CONTROL_GO_NUM; ++i)
|
||||
for (int i = 0; i < NA_CONTROL_GO_NUM; ++i)
|
||||
{
|
||||
DelObject(i);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ void OutdoorPvPSI::UpdateWorldState()
|
||||
|
||||
bool OutdoorPvPSI::SetupOutdoorPvP()
|
||||
{
|
||||
for(int i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
for (int i = 0; i < OutdoorPvPSIBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPSIBuffZones[i]);
|
||||
return true;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ bool OutdoorPvPSI::HandleDropFlag(Player *plr, uint32 spellId)
|
||||
delete go;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if(!go->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT),SI_SILITHYST_MOUND, map, plr->GetPhaseMask(), plr->GetPositionX(),plr->GetPositionY(),plr->GetPositionZ(),plr->GetOrientation(),0,0,0,0,100,GO_STATE_READY))
|
||||
{
|
||||
delete go;
|
||||
|
||||
@@ -60,7 +60,7 @@ void OutdoorPvPTF::FillInitialWorldStates(WorldPacket &data)
|
||||
data << TF_UI_LOCKED_DISPLAY_HORDE << uint32(m_IsLocked && (m_HordeTowersControlled > m_AllianceTowersControlled));
|
||||
data << TF_UI_LOCKED_DISPLAY_ALLIANCE << uint32(m_IsLocked && (m_HordeTowersControlled < m_AllianceTowersControlled));
|
||||
|
||||
for(OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
for (OPvPCapturePointMap::iterator itr = m_capturePoints.begin(); itr != m_capturePoints.end(); ++itr)
|
||||
{
|
||||
itr->second->FillInitialWorldStates(data);
|
||||
}
|
||||
@@ -84,7 +84,7 @@ void OutdoorPvPTF::SendRemoveWorldStates(Player * plr)
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_HORDE,uint32(0));
|
||||
plr->SendUpdateWorldState(TF_UI_LOCKED_DISPLAY_ALLIANCE,uint32(0));
|
||||
|
||||
for(int i = 0; i < TF_TOWER_NUM; ++i)
|
||||
for (int i = 0; i < TF_TOWER_NUM; ++i)
|
||||
{
|
||||
plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].n),uint32(0));
|
||||
plr->SendUpdateWorldState(uint32(TFTowerWorldStates[i].h),uint32(0));
|
||||
@@ -220,7 +220,7 @@ bool OutdoorPvPTF::SetupOutdoorPvP()
|
||||
first_digit = 0;
|
||||
|
||||
// add the zones affected by the pvp buff
|
||||
for(int i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
|
||||
for (int i = 0; i < OutdoorPvPTFBuffZonesNum; ++i)
|
||||
RegisterZone(OutdoorPvPTFBuffZones[i]);
|
||||
|
||||
AddCapturePoint(new OPvPCapturePointTF(this,TF_TOWER_NW));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user