[7487] Avoid attempt use InstanceSave data for non-dungeons.

Also check map existance and correctness at instance data loading.
Removed unused and totally bugged InstanceMap::GetResetTime.
This commit is contained in:
VladimirMangos 2009-03-18 15:57:13 +03:00
parent b3490d3b74
commit a7fd57cc74
6 changed files with 85 additions and 70 deletions

View file

@ -2709,7 +2709,14 @@ void ObjectMgr::LoadGroups()
}
}
InstanceSave *save = sInstanceSaveManager.AddInstanceSave(fields[1].GetUInt32(), fields[2].GetUInt32(), fields[4].GetUInt8(), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
MapEntry const* mapEntry = sMapStore.LookupEntry(fields[1].GetUInt32());
if(!mapEntry || !mapEntry->IsDungeon())
{
sLog.outErrorDb("Incorrect entry in group_instance table : no dungeon map %d", fields[1].GetUInt32());
continue;
}
InstanceSave *save = sInstanceSaveManager.AddInstanceSave(mapEntry->MapID, fields[2].GetUInt32(), fields[4].GetUInt8(), (time_t)fields[5].GetUInt64(), (fields[6].GetUInt32() == 0), true);
group->BindToInstance(save, fields[3].GetBool(), true);
}while( result->NextRow() );
delete result;