From d09d711721afe15bdb072ca4c223c0a646eecbe6 Mon Sep 17 00:00:00 2001 From: Chad Cuddigan Date: Wed, 12 Dec 2018 12:47:54 -0800 Subject: [PATCH] Don't make a dynamic light for the player if their torch color is Black --- .../interrupt/dungeoneer/entities/Player.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Dungeoneer/src/com/interrupt/dungeoneer/entities/Player.java b/Dungeoneer/src/com/interrupt/dungeoneer/entities/Player.java index 7d1e434a..390984b8 100644 --- a/Dungeoneer/src/com/interrupt/dungeoneer/entities/Player.java +++ b/Dungeoneer/src/com/interrupt/dungeoneer/entities/Player.java @@ -1371,13 +1371,15 @@ private void updatePlayerLight(Level level, float delta) { if(offhandItem != null && !isHoldingTwoHanded()) offhandItem.tickEquipped(this, level, delta, "OFFHAND"); // update player light - com.interrupt.dungeoneer.gfx.DynamicLight light = GlRenderer.getLight(); - if(light != null) { - light.color.set(torchColor.r, torchColor.g, torchColor.b); - light.position.set(x, z + getStepUpValue(), y); - light.range = this.torchRange; - - GlRenderer.playerLightColor.set(torchColor.r, torchColor.g, torchColor.b); + if(!torchColor.equals(Color.BLACK)) { + com.interrupt.dungeoneer.gfx.DynamicLight light = GlRenderer.getLight(); + if (light != null) { + light.color.set(torchColor.r, torchColor.g, torchColor.b); + light.position.set(x, z + getStepUpValue(), y); + light.range = this.torchRange; + + GlRenderer.playerLightColor.set(torchColor.r, torchColor.g, torchColor.b); + } } // update some flags