Merge branch 'master' of https://github.com/TrinityCore/TrinityCore
This commit is contained in:
@@ -1776,6 +1776,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_JUMP_TO_POS:
|
||||
{
|
||||
me->GetMotionMaster()->MoveJump(e.target.x, e.target.y , e.target.z, (float)e.action.jump.speedxy, (float)e.action.jump.speedz);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
sLog->outErrorDb("SmartScript::ProcessAction: Unhandled Action type %u", e.GetActionType());
|
||||
break;
|
||||
|
||||
@@ -774,6 +774,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder &e)
|
||||
case SMART_ACTION_SET_DYNAMIC_FLAG:
|
||||
case SMART_ACTION_ADD_DYNAMIC_FLAG:
|
||||
case SMART_ACTION_REMOVE_DYNAMIC_FLAG:
|
||||
case SMART_ACTION_JUMP_TO_POS:
|
||||
break;
|
||||
default:
|
||||
sLog->outErrorDb("SmartAIMgr: Not handled action_type(%u), event_type(%u), Entry %d SourceType %u Event %u, skipped.", e.GetActionType(), e.GetEventType(), e.entryOrGuid, e.GetScriptType(), e.event_id);
|
||||
|
||||
@@ -461,8 +461,9 @@ enum SMART_ACTION
|
||||
SMART_ACTION_SET_DYNAMIC_FLAG = 94, // Flags
|
||||
SMART_ACTION_ADD_DYNAMIC_FLAG = 95, // Flags
|
||||
SMART_ACTION_REMOVE_DYNAMIC_FLAG = 96, // Flags
|
||||
SMART_ACTION_JUMP_TO_POS = 97, // speedXY, speedZ, targetX, targetY, targetZ
|
||||
|
||||
SMART_ACTION_END = 97,
|
||||
SMART_ACTION_END = 98,
|
||||
};
|
||||
|
||||
struct SmartAction
|
||||
@@ -844,6 +845,13 @@ struct SmartAction
|
||||
{
|
||||
uint32 anim;
|
||||
} sendGoCustomAnim;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 speedxy;
|
||||
uint32 speedz;
|
||||
} jump;
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 param1;
|
||||
|
||||
@@ -433,7 +433,8 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::ResetAchievementCriteria(%u, %u, %u)", type, miscvalue1, miscvalue2);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)))
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->isGameMaster())
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
|
||||
@@ -733,7 +734,8 @@ void AchievementMgr::UpdateAchievementCriteria(AchievementCriteriaTypes type, ui
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_ACHIEVEMENTSYS, "AchievementMgr::UpdateAchievementCriteria(%u, %u, %u)", type, miscValue1, miscValue2);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)))
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->isGameMaster())
|
||||
return;
|
||||
|
||||
AchievementCriteriaEntryList const& achievementCriteriaList = sAchievementMgr->GetAchievementCriteriaByType(type);
|
||||
@@ -2000,11 +2002,12 @@ void AchievementMgr::RemoveTimedAchievement(AchievementCriteriaTimedTypes type,
|
||||
}
|
||||
}
|
||||
|
||||
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement, bool ignoreGMAllowAchievementConfig)
|
||||
void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
||||
{
|
||||
sLog->outDetail("AchievementMgr::CompletedAchievement(%u)", achievement->ID);
|
||||
|
||||
if (m_player->GetSession()->GetSecurity() > AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS)) && !ignoreGMAllowAchievementConfig)
|
||||
// disable for gamemasters with GM-mode enabled
|
||||
if (m_player->isGameMaster())
|
||||
return;
|
||||
|
||||
if (achievement->flags & ACHIEVEMENT_FLAG_COUNTER || HasAchieved(achievement))
|
||||
|
||||
@@ -253,7 +253,7 @@ class AchievementMgr
|
||||
void SaveToDB(SQLTransaction& trans);
|
||||
void ResetAchievementCriteria(AchievementCriteriaTypes type, uint32 miscvalue1 = 0, uint32 miscvalue2 = 0, bool evenIfCriteriaComplete = false);
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig = false);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
void CheckAllAchievementCriteria();
|
||||
void SendAllAchievementData() const;
|
||||
void SendRespondInspectAchievements(Player* player) const;
|
||||
|
||||
@@ -430,7 +430,7 @@ void LFGMgr::InitializeLockedDungeons(Player* plr)
|
||||
*/
|
||||
void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeons, const std::string& comment)
|
||||
{
|
||||
if (!plr || !plr->GetSession() || !selectedDungeons.size())
|
||||
if (!plr || !plr->GetSession() || selectedDungeons.empty())
|
||||
return;
|
||||
|
||||
Group* grp = plr->GetGroup();
|
||||
@@ -477,7 +477,7 @@ void LFGMgr::Join(Player* plr, uint8 roles, const LfgDungeonSet& selectedDungeon
|
||||
joinData.result = LFG_JOIN_DESERTER;
|
||||
else if (plr->HasAura(LFG_SPELL_DUNGEON_COOLDOWN))
|
||||
joinData.result = LFG_JOIN_RANDOM_COOLDOWN;
|
||||
else if (!dungeons.size())
|
||||
else if (dungeons.empty())
|
||||
joinData.result = LFG_JOIN_NOT_MEET_REQS;
|
||||
else if (grp)
|
||||
{
|
||||
@@ -763,7 +763,7 @@ bool LFGMgr::CheckCompatibility(LfgGuidList check, LfgProposal*& pProposal)
|
||||
|
||||
std::string strGuids = ConcatenateGuids(check);
|
||||
|
||||
if (check.size() > MAXGROUPSIZE || !check.size())
|
||||
if (check.size() > MAXGROUPSIZE || check.empty())
|
||||
{
|
||||
sLog->outDebug(LOG_FILTER_LFG, "LFGMgr::CheckCompatibility: (%s): Size wrong - Not compatibles", strGuids.c_str());
|
||||
return false;
|
||||
@@ -1163,7 +1163,7 @@ void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& pla
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dungeons.size())
|
||||
if (!dungeons.empty())
|
||||
lockMap.clear();
|
||||
}
|
||||
|
||||
@@ -1176,7 +1176,7 @@ void LFGMgr::GetCompatibleDungeons(LfgDungeonSet& dungeons, const PlayerSet& pla
|
||||
*/
|
||||
bool LFGMgr::CheckGroupRoles(LfgRolesMap& groles, bool removeLeaderFlag /*= true*/)
|
||||
{
|
||||
if (!groles.size())
|
||||
if (groles.empty())
|
||||
return false;
|
||||
|
||||
uint8 damage = 0;
|
||||
|
||||
@@ -1092,7 +1092,7 @@ void GameObject::Use(Unit* user)
|
||||
if (user->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
if (!ChairListSlots.size()) // this is called once at first chair use to make list of available slots
|
||||
if (ChairListSlots.empty()) // this is called once at first chair use to make list of available slots
|
||||
{
|
||||
if (info->chair.slots > 0) // sometimes chairs in DB have error in fields and we dont know number of slots
|
||||
for (uint32 i = 0; i < info->chair.slots; ++i)
|
||||
|
||||
@@ -18588,7 +18588,7 @@ void Player::_SaveMail(SQLTransaction& trans)
|
||||
{
|
||||
trans->PAppend("UPDATE mail SET has_items = '%u', expire_time = '" UI64FMTD "', deliver_time = '" UI64FMTD "', money = '%u', cod = '%u', checked = '%u' WHERE id = '%u'",
|
||||
m->HasItems() ? 1 : 0, (uint64)m->expire_time, (uint64)m->deliver_time, m->money, m->COD, m->checked, m->messageID);
|
||||
if (m->removedItems.size())
|
||||
if (!m->removedItems.empty())
|
||||
{
|
||||
for (std::vector<uint32>::iterator itr2 = m->removedItems.begin(); itr2 != m->removedItems.end(); ++itr2)
|
||||
trans->PAppend("DELETE FROM mail_items WHERE item_guid = '%u'", *itr2);
|
||||
@@ -23436,9 +23436,9 @@ void Player::UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 mis
|
||||
GetAchievementMgr().UpdateAchievementCriteria(type, miscValue1, miscValue2, unit);
|
||||
}
|
||||
|
||||
void Player::CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig)
|
||||
void Player::CompletedAchievement(AchievementEntry const* entry)
|
||||
{
|
||||
GetAchievementMgr().CompletedAchievement(entry, ignoreGMAllowAchievementConfig);
|
||||
GetAchievementMgr().CompletedAchievement(entry);
|
||||
}
|
||||
|
||||
void Player::LearnTalent(uint32 talentId, uint32 talentRank)
|
||||
|
||||
@@ -2420,7 +2420,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
AchievementMgr& GetAchievementMgr() { return m_achievementMgr; }
|
||||
AchievementMgr const& GetAchievementMgr() const { return m_achievementMgr; }
|
||||
void UpdateAchievementCriteria(AchievementCriteriaTypes type, uint32 miscValue1 = 0, uint32 miscValue2 = 0, Unit* unit = NULL);
|
||||
void CompletedAchievement(AchievementEntry const* entry, bool ignoreGMAllowAchievementConfig = false);
|
||||
void CompletedAchievement(AchievementEntry const* entry);
|
||||
|
||||
bool HasTitle(uint32 bitIndex);
|
||||
bool HasTitle(CharTitlesEntry const* title) { return HasTitle(title->bit_index); }
|
||||
|
||||
@@ -5633,12 +5633,12 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
|
||||
triggered_spell_id = 70701;
|
||||
break;
|
||||
}
|
||||
// Essence of the Blood Queen
|
||||
case 70871:
|
||||
{
|
||||
target = this;
|
||||
triggered_spell_id = 70872;
|
||||
basepoints0 = CalculatePctN(int32(damage), triggerAmount);
|
||||
break;
|
||||
CastCustomSpell(70872, SPELLVALUE_BASE_POINT0, basepoints0, this);
|
||||
return true;
|
||||
}
|
||||
case 65032: // Boom aura (321 Boombot)
|
||||
{
|
||||
@@ -17144,8 +17144,10 @@ bool Unit::SetPosition(float x, float y, float z, float orientation, bool telepo
|
||||
|
||||
void Unit::SendThreatListUpdate()
|
||||
{
|
||||
if (uint32 count = getThreatManager().getThreatList().size())
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
|
||||
//sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8);
|
||||
data.append(GetPackGUID());
|
||||
@@ -17162,8 +17164,10 @@ void Unit::SendThreatListUpdate()
|
||||
|
||||
void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
{
|
||||
if (uint32 count = getThreatManager().getThreatList().size())
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
|
||||
sLog->outDebug(LOG_FILTER_UNITS, "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
|
||||
data.append(GetPackGUID());
|
||||
|
||||
@@ -7863,7 +7863,7 @@ bool ObjectMgr::LoadTrinityStrings(char const* table, int32 min_value, int32 max
|
||||
|
||||
TrinityStringLocale& data = mTrinityStringLocaleMap[entry];
|
||||
|
||||
if (data.Content.size() > 0)
|
||||
if (!data.Content.empty())
|
||||
{
|
||||
sLog->outErrorDb("Table `%s` contain data for already loaded entry %i (from another table?), ignored.", table, entry);
|
||||
continue;
|
||||
|
||||
@@ -1574,7 +1574,7 @@ bool Group::InCombatToInstance(uint32 instanceId)
|
||||
for (GroupReference *itr = GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player *pPlayer = itr->getSource();
|
||||
if (pPlayer && pPlayer->getAttackers().size() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
if (pPlayer && !pPlayer->getAttackers().empty() && pPlayer->GetInstanceId() == instanceId && (pPlayer->GetMap()->IsRaidOrHeroicDungeon()))
|
||||
for (std::set<Unit*>::const_iterator i = pPlayer->getAttackers().begin(); i != pPlayer->getAttackers().end(); ++i)
|
||||
if ((*i) && (*i)->GetTypeId() == TYPEID_UNIT && (*i)->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_INSTANCE_BIND)
|
||||
return true;
|
||||
|
||||
@@ -140,7 +140,7 @@ void PoolGroup<T>::AddEntry(PoolObject& poolitem, uint32 maxentries)
|
||||
template <class T>
|
||||
bool PoolGroup<T>::CheckPool() const
|
||||
{
|
||||
if (!EqualChanced.size())
|
||||
if (EqualChanced.empty())
|
||||
{
|
||||
float chance = 0;
|
||||
for (uint32 i = 0; i < ExplicitlyChanced.size(); ++i)
|
||||
@@ -496,7 +496,7 @@ void PoolGroup<Quest>::SpawnObject(ActivePoolData& spawns, uint32 limit, uint32
|
||||
Spawn1Object(&tempObj);
|
||||
newQuests.erase(itr);
|
||||
--limit;
|
||||
} while (limit && newQuests.size());
|
||||
} while (limit && !newQuests.empty());
|
||||
|
||||
// if we are here it means the pool is initialized at startup and did not have previous saved state
|
||||
if (!triggerFrom)
|
||||
@@ -779,7 +779,7 @@ void PoolMgr::LoadFromDB()
|
||||
while (result->NextRow());
|
||||
|
||||
// Now check for circular reference
|
||||
for (uint32 i=0; i<mPoolPoolGroups.size(); ++i)
|
||||
for (uint32 i=0; i < max_pool_id; ++i)
|
||||
{
|
||||
std::set<uint32> checkedPools;
|
||||
for (SearchMap::iterator poolItr = mPoolSearchMap.find(i); poolItr != mPoolSearchMap.end(); poolItr = mPoolSearchMap.find(poolItr->second))
|
||||
|
||||
@@ -285,7 +285,7 @@ void WorldSession::SendLfgUpdatePlayer(const LfgUpdateData& updateData)
|
||||
bool queued = false;
|
||||
bool extrainfo = false;
|
||||
|
||||
switch(updateData.updateType)
|
||||
switch (updateData.updateType)
|
||||
{
|
||||
case LFG_UPDATETYPE_JOIN_PROPOSAL:
|
||||
case LFG_UPDATETYPE_ADDED_TO_QUEUE:
|
||||
@@ -328,7 +328,7 @@ void WorldSession::SendLfgUpdateParty(const LfgUpdateData& updateData)
|
||||
bool extrainfo = false;
|
||||
bool queued = false;
|
||||
|
||||
switch(updateData.updateType)
|
||||
switch (updateData.updateType)
|
||||
{
|
||||
case LFG_UPDATETYPE_JOIN_PROPOSAL:
|
||||
extrainfo = true;
|
||||
@@ -401,7 +401,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck)
|
||||
data << uint32(pRoleCheck->state); // Check result
|
||||
data << uint8(pRoleCheck->state == LFG_ROLECHECK_INITIALITING);
|
||||
data << uint8(dungeons.size()); // Number of dungeons
|
||||
if (dungeons.size())
|
||||
if (!dungeons.empty())
|
||||
{
|
||||
for (LfgDungeonSet::iterator it = dungeons.begin(); it != dungeons.end(); ++it)
|
||||
{
|
||||
@@ -411,7 +411,7 @@ void WorldSession::SendLfgRoleCheckUpdate(const LfgRoleCheck* pRoleCheck)
|
||||
}
|
||||
|
||||
data << uint8(pRoleCheck->roles.size()); // Players in group
|
||||
if (pRoleCheck->roles.size())
|
||||
if (!pRoleCheck->roles.empty())
|
||||
{
|
||||
// Leader info MUST be sent 1st :S
|
||||
uint64 guid = pRoleCheck->leader;
|
||||
|
||||
@@ -317,7 +317,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
|
||||
(_player->GetQuestStatus(questId) != QUEST_STATUS_COMPLETE && !quest->IsAutoComplete()))
|
||||
{
|
||||
sLog->outError("HACK ALERT: Player %s (guid: %u) is trying to complete quest (id: %u) but he has no right to do it!",
|
||||
_player->GetName(), _player->GetGUID(), questId);
|
||||
_player->GetName(), _player->GetGUIDLow(), questId);
|
||||
return;
|
||||
}
|
||||
if (_player->CanRewardQuest(quest, reward, true))
|
||||
|
||||
@@ -854,7 +854,6 @@ void World::LoadConfigSettings(bool reload)
|
||||
|
||||
m_int_configs[CONFIG_GM_LEVEL_IN_GM_LIST] = sConfig->GetIntDefault("GM.InGMList.Level", SEC_ADMINISTRATOR);
|
||||
m_int_configs[CONFIG_GM_LEVEL_IN_WHO_LIST] = sConfig->GetIntDefault("GM.InWhoList.Level", SEC_ADMINISTRATOR);
|
||||
m_int_configs[CONFIG_GM_LEVEL_ALLOW_ACHIEVEMENTS] = sConfig->GetIntDefault("GM.AllowAchievementGain.Level", SEC_ADMINISTRATOR);
|
||||
m_bool_configs[CONFIG_GM_LOG_TRADE] = sConfig->GetBoolDefault("GM.LogTrade", false);
|
||||
m_int_configs[CONFIG_START_GM_LEVEL] = sConfig->GetIntDefault("GM.StartLevel", 1);
|
||||
if (m_int_configs[CONFIG_START_GM_LEVEL] < m_int_configs[CONFIG_START_PLAYER_LEVEL])
|
||||
|
||||
Reference in New Issue
Block a user