Fix for add/remove entities not applying to world view

This commit is contained in:
dexy
2019-12-15 15:40:00 +11:00
Unverified
parent 1b59ef40d0
commit 3f445182f3
2 changed files with 12 additions and 6 deletions
@@ -62,8 +62,8 @@ namespace CodeWalker.GameFiles
//fields used by the editor:
public bool HasChanged { get; set; } = false;
public List<string> SaveWarnings = null;
public bool LodManagerUpdate = false; //forces the LOD manager to refresh this ymap when rendering
public YmapEntityDef[] LodManagerOldEntities = null; //when entities are removed, need the old ones to remove from lod manager
public YmapFile() : base(null, GameFileType.Ymap)
@@ -900,6 +900,7 @@ namespace CodeWalker.GameFiles
}
HasChanged = true;
LodManagerUpdate = true;
}
public bool RemoveEntity(YmapEntityDef ent)
@@ -934,10 +935,12 @@ namespace CodeWalker.GameFiles
res = false;
}
LodManagerOldEntities = AllEntities;
AllEntities = newAllEntities.ToArray();
RootEntities = newRootEntities.ToArray();
HasChanged = true;
LodManagerUpdate = true;
return res;
}