Core/Transports: fixed a crash when loading db spawned transports

* fixed a memory leak
This commit is contained in:
Ovahlord committed 2019-02-25 04:39:01 +01:00
1 parent 8110e13914
commit 1f76228c1b
2 files changed
+12 -6

No files matched your search

@@ -149,6 +149,7 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, Map* map, uint
ASSERT(map);
SetMap(map);
UpdatePositionData();
SetZoneScript();
if (GetZoneScript())
{
@@ -161,6 +162,8 @@ bool Transport::Create(ObjectGuid::LowType guidlow, uint32 entry, Map* map, uint
if (!dynamic)
SetRespawnCompatibilityMode();
guidlow = map->GenerateLowGuid<HighGuid::Transport>();
if (!Transport::CreateTransport(guidlow, entry, map->GetId(), pos, animprogress))
return false;
+9 -6
View File
@@ -197,15 +197,18 @@ void LoadHelper(CellGuidSet const& guid_set, CellCoord &cell, GridRefManager<Gam
continue;
}
}
}
if (!obj->LoadFromDB(guid, map, false, false))
{
if (!obj->LoadFromDB(guid, map, false, false))
{
delete obj;
continue;
}
AddObjectHelper(cell, m, count, map, obj);
}
else
delete obj;
continue;
}
AddObjectHelper(cell, m, count, map, obj);
}
}