mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-26 07:06:23 +00:00
fix(Core): Crashfix. (#12643)
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
--
|
||||
ALTER TABLE `character_entry_point`
|
||||
ADD COLUMN `taxiPath0` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `joinMapId`,
|
||||
ADD COLUMN `taxiPath1` INT UNSIGNED DEFAULT 0 NOT NULL AFTER `taxiPath0`,
|
||||
DROP COLUMN `taxiPath`;
|
||||
@@ -102,7 +102,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_CRITERIAPROGRESS, "SELECT criteria, counter, date FROM character_achievement_progress WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_EQUIPMENTSETS, "SELECT setguid, setindex, name, iconname, ignore_mask, item0, item1, item2, item3, item4, item5, item6, item7, item8, "
|
||||
"item9, item10, item11, item12, item13, item14, item15, item16, item17, item18 FROM character_equipmentsets WHERE guid = ? ORDER BY setindex", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_ENTRY_POINT, "SELECT joinX, joinY, joinZ, joinO, joinMapId, taxiPath, mountSpell FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_ENTRY_POINT, "SELECT joinX, joinY, joinZ, joinO, joinMapId, taxiPath0, taxiPath1, mountSpell FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_GLYPHS, "SELECT talentGroup, glyph1, glyph2, glyph3, glyph4, glyph5, glyph6 FROM character_glyphs WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_TALENTS, "SELECT spell, specMask FROM character_talent WHERE guid = ?", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_SEL_CHARACTER_SKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = ?", CONNECTION_ASYNC);
|
||||
@@ -286,7 +286,7 @@ void CharacterDatabaseConnection::DoPrepareStatements()
|
||||
PrepareStatement(CHAR_UPD_ARENA_TEAM_NAME, "UPDATE arena_team SET name = ? WHERE arenaTeamId = ?", CONNECTION_ASYNC);
|
||||
|
||||
// Character battleground data
|
||||
PrepareStatement(CHAR_INS_PLAYER_ENTRY_POINT, "INSERT INTO character_entry_point (guid, joinX, joinY, joinZ, joinO, joinMapId, taxiPath, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_INS_PLAYER_ENTRY_POINT, "INSERT INTO character_entry_point (guid, joinX, joinY, joinZ, joinO, joinMapId, taxiPath0, taxiPath1, mountSpell) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", CONNECTION_ASYNC);
|
||||
PrepareStatement(CHAR_DEL_PLAYER_ENTRY_POINT, "DELETE FROM character_entry_point WHERE guid = ?", CONNECTION_ASYNC);
|
||||
|
||||
// Character homebind
|
||||
|
||||
@@ -14248,16 +14248,9 @@ void Player::_SaveEntryPoint(CharacterDatabaseTransaction trans)
|
||||
stmt->SetData (3, m_entryPointData.joinPos.GetPositionZ());
|
||||
stmt->SetData (4, m_entryPointData.joinPos.GetOrientation());
|
||||
stmt->SetData(5, m_entryPointData.joinPos.GetMapId());
|
||||
|
||||
std::ostringstream ss("");
|
||||
if (m_entryPointData.HasTaxiPath())
|
||||
{
|
||||
for (size_t i = 0; i < m_entryPointData.taxiPath.size(); ++i)
|
||||
ss << m_entryPointData.taxiPath[i] << ' '; // xinef: segment is stored as last point
|
||||
}
|
||||
|
||||
stmt->SetData(6, ss.str());
|
||||
stmt->SetData(7, m_entryPointData.mountSpell);
|
||||
stmt->SetData(6, m_entryPointData.taxiPath[0]);
|
||||
stmt->SetData(7, m_entryPointData.taxiPath[1]);
|
||||
stmt->SetData(8, m_entryPointData.mountSpell);
|
||||
trans->Append(stmt);
|
||||
}
|
||||
|
||||
|
||||
@@ -1035,11 +1035,11 @@ struct EntryPointData
|
||||
}
|
||||
|
||||
uint32 mountSpell{0};
|
||||
std::vector<uint32> taxiPath;
|
||||
std::array<uint32, 2> taxiPath;
|
||||
WorldLocation joinPos;
|
||||
|
||||
void ClearTaxiPath() { taxiPath.clear(); }
|
||||
[[nodiscard]] bool HasTaxiPath() const { return !taxiPath.empty(); }
|
||||
void ClearTaxiPath() { taxiPath.fill(0); }
|
||||
[[nodiscard]] bool HasTaxiPath() const { return taxiPath[0] && taxiPath[1]; }
|
||||
};
|
||||
|
||||
class Player : public Unit, public GridObject<Player>
|
||||
|
||||
@@ -4894,21 +4894,9 @@ void Player::_LoadEntryPointData(PreparedQueryResult result)
|
||||
fields[2].Get<float>(), // Z
|
||||
fields[3].Get<float>()); // Orientation
|
||||
|
||||
std::string_view taxi = fields[5].Get<std::string_view>();
|
||||
if (!taxi.empty())
|
||||
{
|
||||
for (auto const& itr : Acore::Tokenize(taxi, ' ', false))
|
||||
{
|
||||
uint32 node = Acore::StringTo<uint32>(itr).value_or(0);
|
||||
m_entryPointData.taxiPath.emplace_back(node);
|
||||
}
|
||||
|
||||
// Check integrity
|
||||
if (m_entryPointData.taxiPath.size() < 3)
|
||||
m_entryPointData.ClearTaxiPath();
|
||||
}
|
||||
|
||||
m_entryPointData.mountSpell = fields[6].Get<uint32>();
|
||||
m_entryPointData.taxiPath[0] = fields[5].Get<uint32>();
|
||||
m_entryPointData.taxiPath[1] = fields[6].Get<uint32>();
|
||||
m_entryPointData.mountSpell = fields[7].Get<uint32>();
|
||||
}
|
||||
|
||||
bool Player::LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, ObjectGuid::LowType guid)
|
||||
|
||||
@@ -315,8 +315,6 @@ void FlightPathMovementGenerator::LoadPath(Player* player)
|
||||
bool passedPreviousSegmentProximityCheck = false;
|
||||
for (uint32 i = 0; i < nodes.size(); ++i)
|
||||
{
|
||||
sMapMgr->CreateMap(nodes[i]->mapid, player)->SummonCreature(1, { nodes[i]->x, nodes[i]->y, nodes[i]->z, 0.0f })->SetLevel(i ? i : 1);
|
||||
|
||||
if (passedPreviousSegmentProximityCheck || !src || i_path.empty() || IsNodeIncludedInShortenedPath(i_path[i_path.size() - 1], nodes[i]))
|
||||
{
|
||||
if ((!src || (IsNodeIncludedInShortenedPath(start, nodes[i]) && i >= 2)) &&
|
||||
@@ -349,7 +347,6 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
||||
// remove flag to prevent send object build movement packets for flight state and crash (movement generator already not at top of stack)
|
||||
player->ClearUnitState(UNIT_STATE_IN_FLIGHT);
|
||||
|
||||
uint32 taxiNodeId = player->m_taxi.GetTaxiDestination();
|
||||
player->m_taxi.ClearTaxiDestinations();
|
||||
player->Dismount();
|
||||
player->RemoveUnitFlag(UNIT_FLAG_DISABLE_MOVE | UNIT_FLAG_TAXI_FLIGHT);
|
||||
@@ -363,11 +360,7 @@ void FlightPathMovementGenerator::DoFinalize(Player* player)
|
||||
player->StopMoving();
|
||||
|
||||
// When the player reaches the last flight point, teleport to destination taxi node location
|
||||
if (TaxiNodesEntry const* node = sTaxiNodesStore.LookupEntry(taxiNodeId))
|
||||
{
|
||||
player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ());
|
||||
player->TeleportTo(node->map_id, node->x, node->y, node->z, player->GetOrientation());
|
||||
}
|
||||
player->SetFallInformation(GameTime::GetGameTime().count(), player->GetPositionZ());
|
||||
}
|
||||
|
||||
player->RemovePlayerFlag(PLAYER_FLAGS_TAXI_BENCHMARK);
|
||||
|
||||
Reference in New Issue
Block a user