Skip to content

Commit

Permalink
Refactor entity storage registration
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmacle committed Jun 17, 2017
1 parent 041b190 commit 3a5431f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Concealment/ConcealmentPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,18 @@ public override void Init(ITorchBase torch)
base.Init(torch);
Settings = Persistent<Settings>.Load(Path.Combine(StoragePath, "Concealment.cfg"));
_concealedAabbTree = new MyDynamicAABBTreeD(MyConstants.GAME_PRUNING_STRUCTURE_AABB_EXTENSION);
torch.SessionUnloading += Torch_SessionUnloading;
//torch.SessionUnloading += Torch_SessionUnloading;
RegisterEntityStorage("Concealment", Id);
}

//Init storage component.
private void RegisterEntityStorage(string name, Guid id)
{
var comp = new MyModStorageComponentDefinition
{
Id = new MyDefinitionId(typeof(MyObjectBuilder_ModStorageComponent), "Concealment"),
RegisteredStorageGuids = new[] {Id}
{
Id = new MyDefinitionId(typeof(MyObjectBuilder_ModStorageComponent), name),
RegisteredStorageGuids = new[] { id }
};
MyDefinitionManager.Static.Definitions.AddDefinition(comp);

}

private void Torch_SessionUnloading()
Expand Down

0 comments on commit 3a5431f

Please sign in to comment.