aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/server/game/Garrison/Garrison.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/server/game/Garrison/Garrison.cpp b/src/server/game/Garrison/Garrison.cpp
index d86252cdfb8..b52ebdd9808 100644
--- a/src/server/game/Garrison/Garrison.cpp
+++ b/src/server/game/Garrison/Garrison.cpp
@@ -277,18 +277,27 @@ void Garrison::Upgrade()
void Garrison::Enter() const
{
- WorldLocation loc(_siteLevel->MapID);
- loc.Relocate(_owner);
- _owner->TeleportTo(loc, TELE_TO_SEAMLESS);
+ if (MapEntry const* map = sMapStore.LookupEntry(_siteLevel->MapID))
+ {
+ if (int32(_owner->GetMapId()) == map->ParentMapID)
+ {
+ WorldLocation loc(_siteLevel->MapID);
+ loc.Relocate(_owner);
+ _owner->TeleportTo(loc, TELE_TO_SEAMLESS);
+ }
+ }
}
void Garrison::Leave() const
{
if (MapEntry const* map = sMapStore.LookupEntry(_siteLevel->MapID))
{
- WorldLocation loc(map->ParentMapID);
- loc.Relocate(_owner);
- _owner->TeleportTo(loc, TELE_TO_SEAMLESS);
+ if (_owner->GetMapId() == _siteLevel->MapID)
+ {
+ WorldLocation loc(map->ParentMapID);
+ loc.Relocate(_owner);
+ _owner->TeleportTo(loc, TELE_TO_SEAMLESS);
+ }
}
}