From d9770ed0f9fa6f8d29a67168aedda64ab2e470cb Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 24 Aug 2020 17:52:09 -0400 Subject: [PATCH] Followup to waypoint movement Port From (https://github.com/TrinityCore/TrinityCore/commit/0a133e77d61fc6bafad7b60b74604d5da648ece9) --- Source/Game/Entities/Creature/Creature.cs | 7 ------- Source/Game/Entities/Unit/Unit.Movement.cs | 2 +- Source/Game/Handlers/BattleGroundHandler.cs | 1 + Source/Game/Handlers/NPCHandler.cs | 2 ++ Source/Game/Handlers/QuestHandler.cs | 1 + 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index f01b102ae..711143985 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -105,13 +105,6 @@ namespace Game.Entities ForcedDespawn(0); } - public override void PauseMovement(uint timer = 0, MovementSlot slot = 0) - { - base.PauseMovement(timer, slot); - - SetHomePosition(GetPosition()); - } - public bool IsReturningHome() { if (GetMotionMaster().GetMotionSlotType(MovementSlot.Active) == MovementGeneratorType.Home) diff --git a/Source/Game/Entities/Unit/Unit.Movement.cs b/Source/Game/Entities/Unit/Unit.Movement.cs index cef2b634b..b2182c595 100644 --- a/Source/Game/Entities/Unit/Unit.Movement.cs +++ b/Source/Game/Entities/Unit/Unit.Movement.cs @@ -159,7 +159,7 @@ namespace Game.Entities init.Stop(); } - public virtual void PauseMovement(uint timer = 0, MovementSlot slot = 0) + public void PauseMovement(uint timer = 0, MovementSlot slot = 0) { if (slot >= MovementSlot.Max) return; diff --git a/Source/Game/Handlers/BattleGroundHandler.cs b/Source/Game/Handlers/BattleGroundHandler.cs index d2fea3cf1..d2417cb44 100644 --- a/Source/Game/Handlers/BattleGroundHandler.cs +++ b/Source/Game/Handlers/BattleGroundHandler.cs @@ -40,6 +40,7 @@ namespace Game // Stop the npc if moving unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer)); + unit.SetHomePosition(unit.GetPosition()); BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(unit.GetEntry()); diff --git a/Source/Game/Handlers/NPCHandler.cs b/Source/Game/Handlers/NPCHandler.cs index 08909c245..609a9e75b 100644 --- a/Source/Game/Handlers/NPCHandler.cs +++ b/Source/Game/Handlers/NPCHandler.cs @@ -145,6 +145,7 @@ namespace Game // Stop the npc if moving unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer)); + unit.SetHomePosition(unit.GetPosition()); // If spiritguide, no need for gossip menu, just put player into resurrect queue if (unit.IsSpiritGuide()) @@ -464,6 +465,7 @@ namespace Game // Stop the npc if moving vendor.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer)); + vendor.SetHomePosition(vendor.GetPosition()); VendorItemData vendorItems = vendor.GetVendorItems(); int rawItemCount = vendorItems != null ? vendorItems.GetItemCount() : 0; diff --git a/Source/Game/Handlers/QuestHandler.cs b/Source/Game/Handlers/QuestHandler.cs index b7a2ab017..6f46cf76d 100644 --- a/Source/Game/Handlers/QuestHandler.cs +++ b/Source/Game/Handlers/QuestHandler.cs @@ -74,6 +74,7 @@ namespace Game // Stop the npc if moving creature.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer)); + creature.SetHomePosition(creature.GetPosition()); _player.PlayerTalkClass.ClearMenus(); if (creature.GetAI().GossipHello(_player))