Core/Creature: improve DB linked_respawn handling (#21172)

* Fixed SetCreatureLinkedRespawn function possible erasing/replacing a GameObject link (instead of a creature one)
This commit is contained in:
kelno
2018-01-08 00:32:22 +01:00
committed by joschiwald
parent f0a394753a
commit 70eb18d0e5
7 changed files with 62 additions and 18 deletions
@@ -1029,6 +1029,26 @@ void GameObject::DeleteFromDB()
stmt->setUInt32(0, m_spawnId);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_LINKED_RESPAWN);
stmt->setUInt32(0, m_spawnId);
stmt->setUInt32(1, LINKED_RESPAWN_GO_TO_GO);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_LINKED_RESPAWN);
stmt->setUInt32(0, m_spawnId);
stmt->setUInt32(1, LINKED_RESPAWN_GO_TO_CREATURE);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_LINKED_RESPAWN_MASTER);
stmt->setUInt32(0, m_spawnId);
stmt->setUInt32(1, LINKED_RESPAWN_GO_TO_GO);
trans->Append(stmt);
stmt = WorldDatabase.GetPreparedStatement(WORLD_DEL_LINKED_RESPAWN_MASTER);
stmt->setUInt32(0, m_spawnId);
stmt->setUInt32(1, LINKED_RESPAWN_CREATURE_TO_GO);
trans->Append(stmt);
WorldDatabase.CommitTransaction(trans);
}