Dungeon Finder: Fix Teleport issues

- Trying to leave the dungeon using the portal will teleport you back to the save point
- If group is disbanded all people is teleported out

--HG--
branch : trunk
This commit is contained in:
Spp
2010-08-13 09:24:24 +02:00
parent 4558ac1d2a
commit 0f378aac24
3 changed files with 11 additions and 5 deletions
+6 -1
View File
@@ -374,10 +374,13 @@ uint32 Group::RemoveMember(const uint64 &guid, const uint8 &method)
if (method == 1) if (method == 1)
{ {
data.Initialize(SMSG_GROUP_UNINVITE, 0); data.Initialize(SMSG_GROUP_UNINVITE, 0);
player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
player->GetSession()->SendPacket(&data); player->GetSession()->SendPacket(&data);
} }
player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
if (isLFGGroup() && player->GetMap()->IsDungeon())
player->TeleportToBGEntryPoint();
//we already removed player from group and in player->GetGroup() is his original group! //we already removed player from group and in player->GetGroup() is his original group!
if (Group* group = player->GetGroup()) if (Group* group = player->GetGroup())
{ {
@@ -448,6 +451,8 @@ void Group::Disband(bool hideDestroy)
else else
player->SetGroup(NULL); player->SetGroup(NULL);
if (isLFGGroup() && player->GetMap()->IsDungeon())
player->TeleportToBGEntryPoint();
player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_GROUP_DISBAND); player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_GROUP_DISBAND);
player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER); player->GetSession()->SendLfgUpdateParty(LFG_UPDATETYPE_LEADER);
} }
@@ -32,7 +32,6 @@
#include "Util.h" #include "Util.h"
#include "SpellAuras.h" #include "SpellAuras.h"
#include "Vehicle.h" #include "Vehicle.h"
#include "LFGMgr.h"
class Aura; class Aura;
@@ -384,8 +383,6 @@ void WorldSession::HandleGroupDisbandOpcode(WorldPacket & /*recv_data*/)
SendPartyResult(PARTY_OP_LEAVE, GetPlayer()->GetName(), ERR_PARTY_RESULT_OK); SendPartyResult(PARTY_OP_LEAVE, GetPlayer()->GetName(), ERR_PARTY_RESULT_OK);
GetPlayer()->RemoveFromGroup(); GetPlayer()->RemoveFromGroup();
if (grp->isLFGGroup() && GetPlayer()->GetMap()->IsDungeon())
GetPlayer()->TeleportToBGEntryPoint();
} }
void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data) void WorldSession::HandleLootMethodOpcode(WorldPacket & recv_data)
@@ -937,7 +937,11 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket & recv_data)
if (GetPlayer()->GetMapId() != at->target_mapId && !sMapMgr.CanPlayerEnter(at->target_mapId, GetPlayer(), false)) if (GetPlayer()->GetMapId() != at->target_mapId && !sMapMgr.CanPlayerEnter(at->target_mapId, GetPlayer(), false))
return; return;
GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT); // Check if we are in LfgGroup and trying to get out the dungeon
if (GetPlayer()->GetGroup() && GetPlayer()->GetGroup()->isLFGGroup() && GetPlayer()->GetMap()->IsDungeon() && at->target_mapId != GetPlayer()->GetMapId())
GetPlayer()->TeleportToBGEntryPoint();
else
GetPlayer()->TeleportTo(at->target_mapId,at->target_X,at->target_Y,at->target_Z,at->target_Orientation,TELE_TO_NOT_LEAVE_TRANSPORT);
} }
void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data) void WorldSession::HandleUpdateAccountData(WorldPacket &recv_data)