Core/Dungeon Finder: Corrections to previous commit
- player::inRandomLfgDungeon was supposed to return if current player map and difficulty are the ones player applied for
This commit is contained in:
@@ -1,3 +1,20 @@
|
||||
/*
|
||||
* Copyright (C) 2008-2013 TrinityCore <http://www.trinitycore.org/>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License as published by the
|
||||
* Free Software Foundation; either version 2 of the License, or (at your
|
||||
* option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along
|
||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "LFG.h"
|
||||
#include "Language.h"
|
||||
#include "ObjectMgr.h"
|
||||
|
||||
@@ -1960,7 +1960,7 @@ void LFGMgr::SetupGroupMember(uint64 guid, uint64 gguid)
|
||||
AddPlayerToGroup(gguid, guid);
|
||||
}
|
||||
|
||||
bool LFGMgr::inRandomLfgDungeon(uint64 guid)
|
||||
bool LFGMgr::selectedRandomLfgDungeon(uint64 guid)
|
||||
{
|
||||
if (GetState(guid) != LFG_STATE_NONE)
|
||||
{
|
||||
@@ -1978,6 +1978,9 @@ bool LFGMgr::inRandomLfgDungeon(uint64 guid)
|
||||
|
||||
bool LFGMgr::inLfgDungeonMap(uint64 guid, uint32 map, Difficulty difficulty)
|
||||
{
|
||||
if (!IS_GROUP_GUID(guid))
|
||||
guid = GetGroup(guid);
|
||||
|
||||
if (uint32 dungeonId = GetDungeon(guid, true))
|
||||
if (LFGDungeonData const* dungeon = GetLFGDungeon(dungeonId))
|
||||
if (uint32(dungeon->map) == map && dungeon->difficulty == difficulty)
|
||||
|
||||
@@ -381,7 +381,7 @@ class LFGMgr
|
||||
void SetupGroupMember(uint64 guid, uint64 gguid);
|
||||
uint64 GetGroup(uint64 guid);
|
||||
|
||||
bool inRandomLfgDungeon(uint64 guid);
|
||||
bool selectedRandomLfgDungeon(uint64 guid);
|
||||
bool inLfgDungeonMap(uint64 guid, uint32 map, Difficulty difficulty);
|
||||
|
||||
private:
|
||||
|
||||
@@ -23465,7 +23465,13 @@ bool Player::isUsingLfg()
|
||||
|
||||
bool Player::inRandomLfgDungeon()
|
||||
{
|
||||
return sLFGMgr->inRandomLfgDungeon(GetGUID());
|
||||
if (sLFGMgr->selectedRandomLfgDungeon(GetGUID()))
|
||||
{
|
||||
Map const* map = GetMap();
|
||||
return sLFGMgr->inLfgDungeonMap(GetGUID(), map->GetId(), map->GetDifficulty());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Player::SetBattlegroundOrBattlefieldRaid(Group* group, int8 subgroup)
|
||||
|
||||
@@ -1728,7 +1728,7 @@ class spell_gen_luck_of_the_draw : public SpellScriptLoader
|
||||
if (!group || group->isLFGGroup())
|
||||
return false;
|
||||
|
||||
if (!sLFGMgr->inRandomLfgDungeon(owner->GetGUID()))
|
||||
if (!sLFGMgr->selectedRandomLfgDungeon(owner->GetGUID()))
|
||||
return false;
|
||||
|
||||
map = owner->GetMap();
|
||||
|
||||
Reference in New Issue
Block a user