mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 16:39:08 +01:00
Core/Guild: avoid data integrity problems wrapping delete+insert statements in a transaction
This commit is contained in:
@@ -1843,13 +1843,10 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
{
|
||||
// Reset guild
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER);
|
||||
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (result)
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32()))
|
||||
guild->DeleteMember(factionChangeInfo.Guid, false, false, true);
|
||||
guild->DeleteMember(trans, factionChangeInfo.Guid, false, false, true);
|
||||
|
||||
Player::LeaveAllArenaTeams(factionChangeInfo.Guid);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user