Core/Instances: Implemented confirmation dialog for players upon entering instance which would permanently bind the player to it, players can now choose to get saved or leave the instance

Also fixes broken build
This commit is contained in:
Shauren committed 2011-01-24 11:38:59 +01:00
1 parent e7dbc783cf
commit 820f87f365
8 files changed
+66 -1

No files matched your search

@@ -616,6 +616,8 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
m_ConditionErrorMsgId = 0;
isDebugAreaTriggers = false;
SetPendingBind(NULL, 0);
}
Player::~Player ()
@@ -1498,6 +1500,17 @@ void Player::Update(uint32 p_time)
HandleSobering();
}
if (HasPendingBind())
{
if (_pendingBindTimer <= p_time)
{
BindToInstance();
SetPendingBind(NULL, 0);
}
else
_pendingBindTimer -= p_time;
}
// not auto-free ghost from body in instances
if (m_deathTimer > 0 && !GetBaseMap()->Instanceable())
{
@@ -17688,6 +17701,14 @@ InstancePlayerBind* Player::BindToInstance(InstanceSave *save, bool permanent, b
return NULL;
}
void Player::BindToInstance()
{
WorldPacket data(SMSG_INSTANCE_SAVE_CREATED, 4);
data << uint32(0);
GetSession()->SendPacket(&data);
BindToInstance(_pendingBind, true);
}
void Player::SendRaidInfo()
{
uint32 counter = 0;