Core/Player: Keep shared quests through map changes instead of getting stuck in busy state

Port From (https://github.com/TrinityCore/TrinityCore/commit/c12ee97f122acfd77bd81cf178a77d5054c312b6)
This commit is contained in:
hondacrx
2020-07-24 14:55:22 -04:00
parent 0480e5c4d0
commit 3c054eb054
5 changed files with 39 additions and 27 deletions
+2 -1
View File
@@ -252,7 +252,8 @@ namespace Game.Entities
uint m_PlayedTimeLevel;
Dictionary<byte, ActionButton> m_actionButtons = new Dictionary<byte, ActionButton>();
ObjectGuid m_divider;
ObjectGuid m_playerSharingQuest;
uint m_sharedQuestId;
uint m_ingametime;
PlayerCommandStates _activeCheats;
+5 -3
View File
@@ -33,9 +33,11 @@ namespace Game.Entities
{
public partial class Player
{
public ObjectGuid GetDivider() { return m_divider; }
public void SetDivider(ObjectGuid guid) { m_divider = guid; }
public uint GetSharedQuestID() { return m_sharedQuestId; }
public ObjectGuid GetPlayerSharingQuest() { return m_playerSharingQuest; }
public void SetQuestSharingInfo(ObjectGuid guid, uint id) { m_playerSharingQuest = guid; m_sharedQuestId = id; }
public void ClearQuestSharingInfo() { m_playerSharingQuest = ObjectGuid.Empty; m_sharedQuestId = 0; }
uint GetInGameTime() { return m_ingametime; }
public void SetInGameTime(uint time) { m_ingametime = time; }
+9
View File
@@ -5806,6 +5806,15 @@ namespace Game.Entities
_garrison.SendRemoteInfo();
UpdateItemLevelAreaBasedScaling();
if (!GetPlayerSharingQuest().IsEmpty())
{
Quest quest = Global.ObjectMgr.GetQuestTemplate(GetSharedQuestID());
if (quest != null)
PlayerTalkClass.SendQuestGiverQuestDetails(quest, GetGUID(), true, false);
else
ClearQuestSharingInfo();
}
}
public void RemoveSocial()