2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 23:07:43 +00:00

Various fixes

This commit is contained in:
Jack Andersen
2018-05-16 18:55:33 -10:00
parent e943a60694
commit 055c8e8a47
4 changed files with 24 additions and 13 deletions

View File

@@ -2339,7 +2339,18 @@ void CStateManager::RemoveObject(TUniqueId uid)
if (CEntity* ent = GetAllObjectList().GetValidObjectById(uid))
{
if (ent->GetEditorId() != kInvalidEditorId)
x890_scriptIdMap.erase(ent->GetEditorId());
{
auto search = x890_scriptIdMap.equal_range(ent->GetEditorId());
for (auto it = search.first; it != search.second;)
{
if (it->second == uid)
{
it = x890_scriptIdMap.erase(it);
continue;
}
++it;
}
}
if (ent->GetAreaIdAlways() != kInvalidAreaId)
{
CGameArea* area = x850_world->GetArea(ent->GetAreaIdAlways());