From 96f2c2ac7a7dbc38bc463954b5b4000ace35bc42 Mon Sep 17 00:00:00 2001 From: Jeasonfire Date: Sun, 17 May 2015 02:41:54 +0300 Subject: [PATCH] Fixed debug renderer. --- .../src/com/saltosion/gladiator/systems/RenderingSystem.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java index dbe73b4..aeca46c 100644 --- a/core/src/com/saltosion/gladiator/systems/RenderingSystem.java +++ b/core/src/com/saltosion/gladiator/systems/RenderingSystem.java @@ -203,6 +203,9 @@ public class RenderingSystem extends EntitySystem { batch.begin(); for (int i = 0; i < entities.size(); i++) { CRenderedObject renderedObject = rom.get(entities.get(i)); + if (renderedObject == null) { + continue; + } for (String channel : renderedObject.getChannels()) { SpriteSequence currSequence = renderedObject.getSequence(renderedObject.getCurrentSequence(channel)); int currFrame = (int) Math.floor(renderedObject.getCurrentFrame(channel)); @@ -298,7 +301,7 @@ public class RenderingSystem extends EntitySystem { } public void updateEntities(Engine engine) { - entities = engine.getEntitiesFor(Family.getFor(CRenderedObject.class, CPhysics.class)); + entities = engine.getEntitiesFor(Family.getFor(CPhysics.class)); } public boolean getDebug() {