Remove all references to entities that have already been deleted from scene.
ETHEntity@ orc = SeekEntity("orc.ent"); ETHEntity@ elf = SeekEntity("elf.ent"); ETHEntityArray soldiers; soldiers.Insert(orc); soldiers.Insert(elf); // deletes the orc from scene DeleteEntity(orc); // since orc is gone, this method will remove it from the array soldiers.RemoveDeadEntities(); print("Number of soldiers in the array: " + soldiers.Size());
Output:
Number of soldiers in the array: 1