Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ internal class BounceZone : ComponentBase
private int _ticks;
private int _fastStart;

private readonly HashSet<Type> _skipEntityTypes = new HashSet<Type> { /* Add pre-ignored Types Here */ };
private readonly List <MyEntity> _managedEntities = new List<MyEntity>(1000);

private readonly BoxDrawing _sphereDraw;
Expand Down Expand Up @@ -81,17 +80,13 @@ private bool ShouldProcessEntity(MyEntity ent)
Type entType = ent.GetType();

// Fast check against cache
if (_skipEntityTypes.Contains(entType) || ent.MarkedForClose || ent.IsPreview || ent.Physics == null || ent.Physics.IsPhantom || !ent.InScene)
{
if (ent.MarkedForClose || ent.IsPreview || ent.Physics == null || ent.Physics.IsPhantom || !ent.InScene)
return false;
}

var grid = ent as MyCubeGrid;
var player = ent as IMyCharacter;
if (grid == null && player == null)
{
// Cache this type for future fast checks
_skipEntityTypes.Add(entType);
return false;
}

Expand Down