mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-13 21:49:49 +01:00
*Try to fix a crash caused by corpse. Thanks to new001.
--HG-- branch : trunk
This commit is contained in:
@@ -309,7 +309,7 @@ void InstanceSaveManager::CleanupInstances()
|
||||
delete result;
|
||||
}
|
||||
|
||||
// gameobject_respawn
|
||||
// characters
|
||||
result = CharacterDatabase.Query("SELECT DISTINCT(instance_id) FROM characters WHERE instance_id <> 0");
|
||||
if( result )
|
||||
{
|
||||
@@ -323,6 +323,20 @@ void InstanceSaveManager::CleanupInstances()
|
||||
delete result;
|
||||
}
|
||||
|
||||
// corpse
|
||||
result = CharacterDatabase.Query("SELECT DISTINCT(instance) FROM corpse WHERE instance <> 0");
|
||||
if( result )
|
||||
{
|
||||
do
|
||||
{
|
||||
Field *fields = result->Fetch();
|
||||
if(InstanceSet.find(fields[0].GetUInt32()) == InstanceSet.end())
|
||||
CharacterDatabase.PExecute("UPDATE corpse SET instance = '0' WHERE instance = '%u'", fields[0].GetUInt32());
|
||||
}
|
||||
while (result->NextRow());
|
||||
delete result;
|
||||
}
|
||||
|
||||
bar.step();
|
||||
sLog.outString();
|
||||
sLog.outString( ">> Initialized %u instances", (uint32)InstanceSet.size());
|
||||
|
||||
Reference in New Issue
Block a user