Fix some crashes in mod communication

This commit is contained in:
Brant Martin
2018-12-26 10:52:54 -05:00
parent 66b7adf485
commit f9d75856d1
2 changed files with 16 additions and 16 deletions

View File

@@ -24,18 +24,16 @@ namespace Torch.Mod.Messages
public override void ProcessClient()
{
MyAPIGateway.Parallel.ForEach(EntityId, id =>
{
IMyEntity e;
if (!MyAPIGateway.Entities.TryGetEntityById(id, out e))
return;
//MyAPIGateway.Parallel.ForEach(EntityId, id =>
foreach (var id in EntityId)
{
IMyEntity e;
if (!MyAPIGateway.Entities.TryGetEntityById(id, out e))
continue;
var v = e as IMyVoxelBase;
if (v == null)
return;
v.Storage.Reset(MyStorageDataTypeFlags.All);
});
var v = e as IMyVoxelBase;
v?.Storage.Reset(MyStorageDataTypeFlags.All);
}
}
public override void ProcessServer()