Core/Position: Position constructor improvements

Port From (https://github.com/TrinityCore/TrinityCore/commit/d6ae7030dac388bbdf79954bd235c98209b53630)
This commit is contained in:
Hondacrx
2024-11-17 13:51:42 -05:00
parent f23db214ae
commit c3df9bae16
2 changed files with 36 additions and 12 deletions
+5 -9
View File
@@ -266,20 +266,16 @@ namespace Game.Garrisons
void Enter()
{
WorldLocation loc = new(_siteLevel.MapID);
loc.Relocate(_owner);
_owner.TeleportTo(loc, TeleportToOptions.Seamless);
MapRecord map = CliDB.MapStorage.LookupByKey(_siteLevel.MapID);
if (map != null && _owner.GetMapId() == map.ParentMapID)
_owner.TeleportTo(new WorldLocation(_siteLevel.MapID, _owner), TeleportToOptions.Seamless);
}
void Leave()
{
MapRecord map = CliDB.MapStorage.LookupByKey(_siteLevel.MapID);
if (map != null)
{
WorldLocation loc = new((uint)map.ParentMapID);
loc.Relocate(_owner);
_owner.TeleportTo(loc, TeleportToOptions.Seamless);
}
if (map != null && _owner.GetMapId() == _siteLevel.MapID)
_owner.TeleportTo(new WorldLocation((uint)map.ParentMapID, _owner), TeleportToOptions.Seamless);
}
public uint GetFaction()