aboutsummaryrefslogtreecommitdiff
path: root/src/game/ObjectMgr.cpp
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-18 20:41:49 -0600
committermegamage <none@none>2009-03-18 20:41:49 -0600
commitef47783882e609406f879856d2d3ce5ee865ec80 (patch)
tree36b74ab2ac2b05d81a4f4ebc49434d83f13c8600 /src/game/ObjectMgr.cpp
parent1c8775258422f1c51f4aa363191f2386ff01cd08 (diff)
[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
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r--src/game/ObjectMgr.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp
index 3abd08c07dc..1045cf982d2 100644
--- a/src/game/ObjectMgr.cpp
+++ b/src/game/ObjectMgr.cpp
@@ -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;