Revert "Add (core\db): Support for Homebind Orientation (#13389)" (#19257)

* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

This reverts commit 2e6f6e26da.

 Changes to be committed:
	modified:   src/server/database/Database/Implementation/CharacterDatabase.cpp
	modified:   src/server/game/DungeonFinding/LFGScripts.cpp
	modified:   src/server/game/Entities/Player/Player.cpp
	modified:   src/server/game/Entities/Player/Player.h
	modified:   src/server/game/Entities/Player/PlayerStorage.cpp
	modified:   src/server/game/Entities/Player/PlayerUpdates.cpp
	modified:   src/server/game/Handlers/CharacterHandler.cpp
	modified:   src/server/game/Handlers/MiscHandler.cpp
	modified:   src/server/game/Handlers/MovementHandler.cpp
	modified:   src/server/game/Maps/Map.cpp
	modified:   src/server/game/Spells/Spell.cpp
	modified:   src/server/scripts/Commands/cs_misc.cpp
	modified:   src/server/scripts/Commands/cs_tele.cpp
	modified:   src/server/scripts/Northrend/VaultOfArchavon/instance_vault_of_archavon.cpp

 Untracked files:
	data/sql/updates/pending_db_world/rev_1719945200692175000.sql

* Revert "Add (core\db): Support for Homebind Orientation (#13389)"

* whoops
This commit is contained in:
Kitzunu
2024-07-02 22:02:15 +02:00
committed by GitHub
parent c1488f5076
commit f96d4c8670
15 changed files with 36 additions and 38 deletions

View File

@@ -345,7 +345,6 @@ Player::Player(WorldSession* session): Unit(true), m_mover(this)
m_homebindX = 0;
m_homebindY = 0;
m_homebindZ = 0;
m_homebindO = 0;
m_contestedPvPTimer = 0;
@@ -1606,7 +1605,7 @@ bool Player::TeleportToEntryPoint()
if (loc.m_mapId == MAPID_INVALID)
{
return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
return TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
}
return TeleportTo(loc);
@@ -4911,7 +4910,7 @@ void Player::RepopAtGraveyard()
}
}
else if (GetPositionZ() < GetMap()->GetMinHeight(GetPositionX(), GetPositionY()))
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
TeleportTo(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, GetOrientation());
RemovePlayerFlag(PLAYER_FLAGS_IS_OUT_OF_BOUNDS);
}
@@ -11262,7 +11261,7 @@ void Player::SetEntryPoint()
}
if (m_entryPointData.joinPos.m_mapId == MAPID_INVALID)
m_entryPointData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
m_entryPointData.joinPos = WorldLocation(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, 0.0f);
}
void Player::LeaveBattleground(Battleground* bg)

View File

@@ -2349,7 +2349,6 @@ public:
float m_homebindX;
float m_homebindY;
float m_homebindZ;
float m_homebindO;
[[nodiscard]] WorldLocation GetStartPosition() const;

View File

@@ -4913,7 +4913,7 @@ bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, flo
void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
{
loc.GetPosition(m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
loc.GetPosition(m_homebindX, m_homebindY, m_homebindZ);
m_homebindMapId = loc.GetMapId();
m_homebindAreaId = areaId;
@@ -4921,11 +4921,10 @@ void Player::SetHomebind(WorldLocation const& loc, uint32 areaId)
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_PLAYER_HOMEBIND);
stmt->SetData(0, m_homebindMapId);
stmt->SetData(1, m_homebindAreaId);
stmt->SetData(2, m_homebindX);
stmt->SetData(3, m_homebindY);
stmt->SetData(4, m_homebindZ);
stmt->SetData(5, m_homebindO);
stmt->SetData(6, GetGUID().GetCounter());
stmt->SetData (2, m_homebindX);
stmt->SetData (3, m_homebindY);
stmt->SetData (4, m_homebindZ);
stmt->SetData(5, GetGUID().GetCounter());
CharacterDatabase.Execute(stmt);
}
@@ -5099,7 +5098,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
std::string taxi_nodes = fields[42].Get<std::string>();
auto RelocateToHomebind = [this, &mapId, &instanceId]() { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ, m_homebindO); };
auto RelocateToHomebind = [this, &mapId, &instanceId]() { mapId = m_homebindMapId; instanceId = 0; Relocate(m_homebindX, m_homebindY, m_homebindZ); };
_LoadGroup();
@@ -7014,7 +7013,7 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
}
bool ok = false;
// SELECT mapId, zoneId, posX, posY, posZ, pozO FROM character_homebind WHERE guid = ?
// SELECT mapId, zoneId, posX, posY, posZ FROM character_homebind WHERE guid = ?
if (result)
{
Field* fields = result->Fetch();
@@ -7024,12 +7023,11 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
m_homebindX = fields[2].Get<float>();
m_homebindY = fields[3].Get<float>();
m_homebindZ = fields[4].Get<float>();
m_homebindO = fields[5].Get<float>();
MapEntry const* bindMapEntry = sMapStore.LookupEntry(m_homebindMapId);
// accept saved data only for valid position (and non instanceable), and accessable
if (MapMgr::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO) &&
if (MapMgr::IsValidMapCoord(m_homebindMapId, m_homebindX, m_homebindY, m_homebindZ) &&
!bindMapEntry->Instanceable() && GetSession()->Expansion() >= bindMapEntry->Expansion())
ok = true;
else
@@ -7047,20 +7045,19 @@ bool Player::_LoadHomeBind(PreparedQueryResult result)
m_homebindX = info->positionX;
m_homebindY = info->positionY;
m_homebindZ = info->positionZ;
m_homebindO = info->orientation;
CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_PLAYER_HOMEBIND);
stmt->SetData(0, GetGUID().GetCounter());
stmt->SetData(1, m_homebindMapId);
stmt->SetData(2, m_homebindAreaId);
stmt->SetData(3, m_homebindX);
stmt->SetData(4, m_homebindY);
stmt->SetData(5, m_homebindZ);
stmt->SetData(6, m_homebindO);
stmt->SetData (3, m_homebindX);
stmt->SetData (4, m_homebindY);
stmt->SetData (5, m_homebindZ);
CharacterDatabase.Execute(stmt);
}
LOG_DEBUG("entities.player", "Setting player home position - mapid: {}, areaid: {}, X: {}, Y: {}, Z: {}, O: {}",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ, m_homebindO);
LOG_DEBUG("entities.player", "Setting player home position - mapid: {}, areaid: {}, X: {}, Y: {}, Z: {}",
m_homebindMapId, m_homebindAreaId, m_homebindX, m_homebindY, m_homebindZ);
return true;
}

View File

@@ -1016,7 +1016,7 @@ void Player::UpdateCombatSkills(Unit* victim, WeaponAttackType attType, bool def
chance = chance < 1.0f ? 1.0f : chance; // minimum chance to increase skill is 1%
LOG_DEBUG("entities.player", "Player::UpdateCombatSkills(defence:{}, playerLevel:{}, moblevel:{}) -> ({}/{}) chance to increase skill is {}%", defence, playerLevel, moblevel, currentSkillValue, currentSkillMax, chance);
LOG_DEBUG("entities.player", "Player::UpdateCombatSkills(defence:{}, playerLevel:{}, moblevel:{}) -> ({}/{}) chance to increase skill is {}\%", defence, playerLevel, moblevel, currentSkillValue, currentSkillMax, chance);
if (roll_chance_f(chance))
{