Core/Dungeon Finder: Some optimizations.

- Store teleport coordinates to avoid recalculations each time someone has to be teleported
- Correct teleport error msg when player is charming or using vehicle
- Internal changes in storage types
- Proper code for missing achievement lock type
- Better debug msgs
- Trying to get rid of "Player*" and "Group*" inside LFGMgr as much as possible (Step 1)
This commit is contained in:
Spp committed 2012-10-18 09:15:10 +02:00
1 parent ca276292dc
commit d0334bf948
23 files changed
+940 -714

No files matched your search

+18 -4
View File
@@ -11901,7 +11901,7 @@ InventoryResult Player::CanRollForItemInLFG(ItemTemplate const* proto, WorldObje
bool lootedObjectInDungeon = false;
Map const* map = lootedObject->GetMap();
if (uint32 dungeonId = sLFGMgr->GetDungeon(GetGroup()->GetGUID(), true))
if (LFGDungeonEntry const* dungeon = sLFGDungeonStore.LookupEntry(dungeonId))
if (LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(dungeonId))
if (uint32(dungeon->map) == map->GetId() && dungeon->difficulty == uint32(map->GetDifficulty()))
lootedObjectInDungeon = true;
@@ -23261,7 +23261,7 @@ PartyResult Player::CanUninviteFromGroup() const
if (state == LFG_STATE_BOOT)
return ERR_PARTY_LFG_BOOT_IN_PROGRESS;
if (grp->GetMembersCount() <= sLFGMgr->GetVotesNeeded(gguid))
if (grp->GetMembersCount() <= LFG_GROUP_KICK_VOTES_NEEDED)
return ERR_PARTY_LFG_BOOT_TOO_FEW_PLAYERS;
if (state == LFG_STATE_FINISHED_DUNGEON)
@@ -23294,8 +23294,22 @@ PartyResult Player::CanUninviteFromGroup() const
bool Player::isUsingLfg()
{
uint64 guid = GetGUID();
return sLFGMgr->GetState(guid) != LFG_STATE_NONE;
return sLFGMgr->GetState(GetGUID()) != LFG_STATE_NONE;
}
bool Player::inRandomLfgDungeon()
{
if (isUsingLfg())
{
const LfgDungeonSet& dungeons = sLFGMgr->GetSelectedDungeons(GetGUID());
if (!dungeons.empty())
{
LFGDungeonEntry const* dungeon = sLFGMgr->GetLFGDungeon(*dungeons.begin());
if (dungeon && (dungeon->type == LFG_TYPE_RANDOM || dungeon->seasonal))
return true;
}
}
return false;
}
void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup)