Core/Transports: Fixed crashes when instance with transports unloads
Closes #11056
This commit is contained in:
1 parent
e21eef5c4a
commit
5259539a5f
4 files changed
+25
-2
No files matched your search
@@ -63,6 +63,17 @@ Map::~Map()
|
||||
obj->ResetMap();
|
||||
}
|
||||
|
||||
for (TransportsContainer::iterator itr = _transports.begin(); itr != _transports.end(); ++itr)
|
||||
{
|
||||
Transport* transport = *itr;
|
||||
// Destroy local transports
|
||||
if (transport->GetTransportTemplate()->inInstance)
|
||||
{
|
||||
transport->RemoveFromWorld();
|
||||
delete transport;
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_scriptSchedule.empty())
|
||||
sScriptMgr->DecreaseScheduledScriptCount(m_scriptSchedule.size());
|
||||
|
||||
|
||||
Reference in new issue
Block a user