Followup to waypoint movement
Port From (https://github.com/TrinityCore/TrinityCore/commit/0a133e77d61fc6bafad7b60b74604d5da648ece9)
This commit is contained in:
@@ -105,13 +105,6 @@ namespace Game.Entities
|
|||||||
ForcedDespawn(0);
|
ForcedDespawn(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PauseMovement(uint timer = 0, MovementSlot slot = 0)
|
|
||||||
{
|
|
||||||
base.PauseMovement(timer, slot);
|
|
||||||
|
|
||||||
SetHomePosition(GetPosition());
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsReturningHome()
|
public bool IsReturningHome()
|
||||||
{
|
{
|
||||||
if (GetMotionMaster().GetMotionSlotType(MovementSlot.Active) == MovementGeneratorType.Home)
|
if (GetMotionMaster().GetMotionSlotType(MovementSlot.Active) == MovementGeneratorType.Home)
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ namespace Game.Entities
|
|||||||
init.Stop();
|
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)
|
if (slot >= MovementSlot.Max)
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ namespace Game
|
|||||||
|
|
||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
||||||
|
unit.SetHomePosition(unit.GetPosition());
|
||||||
|
|
||||||
BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(unit.GetEntry());
|
BattlegroundTypeId bgTypeId = Global.BattlegroundMgr.GetBattleMasterBG(unit.GetEntry());
|
||||||
|
|
||||||
|
|||||||
@@ -145,6 +145,7 @@ namespace Game
|
|||||||
|
|
||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
unit.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
||||||
|
unit.SetHomePosition(unit.GetPosition());
|
||||||
|
|
||||||
// If spiritguide, no need for gossip menu, just put player into resurrect queue
|
// If spiritguide, no need for gossip menu, just put player into resurrect queue
|
||||||
if (unit.IsSpiritGuide())
|
if (unit.IsSpiritGuide())
|
||||||
@@ -464,6 +465,7 @@ namespace Game
|
|||||||
|
|
||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
vendor.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
vendor.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
||||||
|
vendor.SetHomePosition(vendor.GetPosition());
|
||||||
|
|
||||||
VendorItemData vendorItems = vendor.GetVendorItems();
|
VendorItemData vendorItems = vendor.GetVendorItems();
|
||||||
int rawItemCount = vendorItems != null ? vendorItems.GetItemCount() : 0;
|
int rawItemCount = vendorItems != null ? vendorItems.GetItemCount() : 0;
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ namespace Game
|
|||||||
|
|
||||||
// Stop the npc if moving
|
// Stop the npc if moving
|
||||||
creature.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
creature.PauseMovement(WorldConfig.GetUIntValue(WorldCfg.CreatureStopForPlayer));
|
||||||
|
creature.SetHomePosition(creature.GetPosition());
|
||||||
|
|
||||||
_player.PlayerTalkClass.ClearMenus();
|
_player.PlayerTalkClass.ClearMenus();
|
||||||
if (creature.GetAI().GossipHello(_player))
|
if (creature.GetAI().GossipHello(_player))
|
||||||
|
|||||||
Reference in New Issue
Block a user