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

Also check map existance and correctness at instance data loading.
    Removed unused and totally bugged InstanceMap::GetResetTime.

--HG--
branch : trunk
This commit is contained in:
megamage
2009-03-18 20:41:49 -06:00
parent 1c87752584
commit ef47783882
5 changed files with 85 additions and 73 deletions

View File

@@ -2808,7 +2808,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;