mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +00:00
[10640] Implement instance guids with proper HIGHGUID_INSTANCE use.
Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
365c4a19e0
commit
d53fe93e9d
12 changed files with 28 additions and 27 deletions
|
|
@ -6166,6 +6166,13 @@ void ObjectMgr::SetHighestGuids()
|
|||
delete result;
|
||||
}
|
||||
|
||||
result = CharacterDatabase.Query( "SELECT MAX(id) FROM instance" );
|
||||
if( result )
|
||||
{
|
||||
m_InstanceGuids.Set((*result)[0].GetUInt32()+1);
|
||||
delete result;
|
||||
}
|
||||
|
||||
// Cleanup other tables from nonexistent guids (>=m_hiItemGuid)
|
||||
CharacterDatabase.PExecute("DELETE FROM character_inventory WHERE item >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
|
||||
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE item_guid >= '%u'", m_ItemGuids.GetNextAfterMaxUsed());
|
||||
|
|
@ -6243,6 +6250,8 @@ uint32 ObjectMgr::GenerateLowGuid(HighGuid guidhigh)
|
|||
return m_GameobjectGuids.Generate();
|
||||
case HIGHGUID_CORPSE:
|
||||
return m_CorpseGuids.Generate();
|
||||
case HIGHGUID_INSTANCE:
|
||||
return m_InstanceGuids.Generate();
|
||||
default:
|
||||
MANGOS_ASSERT(0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue