mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 02:04:52 +01:00
Core/Transports: fixed a crash when loading db spawned transports
* fixed a memory leak
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user