You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found that a crash will sometimes occur without a null check in processSystem.
The code should be the following:
for (int i = 0, s = entities.size(); s > i; i++) {
if (array[i] != null)
process((Entity) array[i]);
}
public abstract class EntityProcessingSystem extends EntitySystem {
/**
* Creates a new EntityProcessingSystem.
* @param aspect
* the aspect to match entities
*/
public EntityProcessingSystem(Aspect.Builder aspect) {
super(aspect);
}
public EntityProcessingSystem() {
}
/**
* Process a entity this system is interested in.
* @param e
* the entity to process
*/
protected abstract void process(Entity e);
/** @inheritDoc */
@Override
protected final void processSystem() {
Bag<Entity> entities = getEntities();
Object[] array = entities.getData();
for (int i = 0, s = entities.size(); s > i; i++) {
process((Entity) array[i]);
}
}
}
The text was updated successfully, but these errors were encountered:
I have found that a crash will sometimes occur without a null check in processSystem.
The code should be the following:
for (int i = 0, s = entities.size(); s > i; i++) {
if (array[i] != null)
process((Entity) array[i]);
}
public abstract class EntityProcessingSystem extends EntitySystem {
}
The text was updated successfully, but these errors were encountered: