rendered paste bodyIndex: src/game/MapInstanced.cpp
===================================================================
--- src/game/MapInstanced.cpp (revision 5293)
+++ src/game/MapInstanced.cpp (working copy)
@@ -296,15 +296,15 @@
void MapInstanced::CreateInstance(uint32 InstanceId, Map* &map)
{
- if (!IsValidInstance(InstanceId))
- {
+ {
+ Guard guard(*this);
+ if (!IsValidInstance(InstanceId))
+ {
// instance is invalid, need to verify map presence
if (map)
{
// map for the instance is present, but the instance itself is no more valid, destroy map
- Guard guard(*this);
-
- map->Reset();
+ map->Reset();
m_InstancedMaps.erase(InstanceId);
delete map;
map = NULL;
@@ -320,6 +320,7 @@
map = new Map(GetId(), GetGridExpiry(), InstanceId);
m_InstancedMaps[InstanceId] = map;
}
+ }
}
bool MapInstanced::IsValidInstance(uint32 InstanceId)