aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2022-01-17 17:01:12 +0100
committerModoX <moardox@gmail.com>2022-01-17 17:02:44 +0100
commitd342be8c79a126ef01db9423484449d3ba7d97c7 (patch)
treed911de8a849c21f299aa915fbe79eb3a54b790e3
parent3346366b0ebc8feb10c6a113d884b095f558998d (diff)
Core/Spells: Using hearthstone will teleport caster to map again
Closes #27623
-rw-r--r--src/server/game/Entities/Player/Player.cpp2
-rw-r--r--src/server/game/Spells/Spell.cpp7
-rw-r--r--src/server/game/Spells/SpellDefines.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index aabbb560cf3..6ad43a50b51 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -18111,7 +18111,7 @@ bool Player::LoadFromDB(ObjectGuid guid, CharacterDatabaseQueryHolder* holder)
SetRaidDifficultyID(CheckLoadedRaidDifficultyID(fields.raidDifficulty));
SetLegacyRaidDifficultyID(CheckLoadedLegacyRaidDifficultyID(fields.legacyRaidDifficulty));
-#define RelocateToHomebind(){ instanceId = 0; WorldRelocate(m_homebind); }
+#define RelocateToHomebind(){ mapId = m_homebind.GetMapId(); instanceId = 0; WorldRelocate(m_homebind); }
_LoadGroup(holder->GetPreparedResult(PLAYER_LOGIN_QUERY_LOAD_GROUP));
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index ad8e6d3191f..7afa210808f 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -84,6 +84,13 @@ SpellDestination::SpellDestination(Position const& pos)
_transportOffset.Relocate(0, 0, 0, 0);
}
+SpellDestination::SpellDestination(WorldLocation const& loc)
+{
+ _position.WorldRelocate(loc);
+ _transportGUID.Clear();
+ _transportOffset.Relocate(0, 0, 0, 0);
+}
+
SpellDestination::SpellDestination(WorldObject const& wObj)
{
_transportGUID = wObj.GetTransGUID();
diff --git a/src/server/game/Spells/SpellDefines.h b/src/server/game/Spells/SpellDefines.h
index 94991f10c7d..23defe8cf26 100644
--- a/src/server/game/Spells/SpellDefines.h
+++ b/src/server/game/Spells/SpellDefines.h
@@ -304,6 +304,7 @@ struct TC_GAME_API SpellDestination
SpellDestination();
SpellDestination(float x, float y, float z, float orientation = 0.0f, uint32 mapId = MAPID_INVALID);
SpellDestination(Position const& pos);
+ SpellDestination(WorldLocation const& loc);
SpellDestination(WorldObject const& wObj);
void Relocate(Position const& pos);