From 7f76f4c680fb927dfd2d45c542c225f77b2eef8a Mon Sep 17 00:00:00 2001 From: Collin Smith Date: Fri, 12 Apr 2019 01:43:29 -0700 Subject: [PATCH] Removed redundant null checks for AI --- core/src/com/riiablo/entity/Monster.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/com/riiablo/entity/Monster.java b/core/src/com/riiablo/entity/Monster.java index a517a68f..c68f5e02 100644 --- a/core/src/com/riiablo/entity/Monster.java +++ b/core/src/com/riiablo/entity/Monster.java @@ -134,12 +134,12 @@ public class Monster extends Entity { @Override public void interact(GameScreen gameScreen) { if (!monstats.interact) return; - if (ai != null) ai.interact(gameScreen); + ai.interact(gameScreen); } @Override public void update(float delta) { - if (ai != null) ai.update(delta); + ai.update(delta); super.update(delta); } @@ -208,8 +208,6 @@ public class Monster extends Entity { @Override protected void appendToStatus(StringBuilder builder) { - if (ai != null) { - builder.append(ai.getState()).append('\n'); - } + builder.append(ai.getState()).append('\n'); } }