Skip to content

Commit

Permalink
Don't make a dynamic light for the player if their torch color is Black
Browse files Browse the repository at this point in the history
  • Loading branch information
Interrupt committed Dec 12, 2018
1 parent d5695bd commit d09d711
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Dungeoneer/src/com/interrupt/dungeoneer/entities/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d09d711

Please sign in to comment.