From 84e854d524f87323c8333efee73a14022f9ca855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20L=C3=B8vbr=C3=B8tte=20Olsen?= Date: Mon, 3 Apr 2017 11:41:13 +0200 Subject: [PATCH] Update borg.h --- School/vg2/borg/borg.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/School/vg2/borg/borg.h b/School/vg2/borg/borg.h index c1a5a93..fa7ce17 100644 --- a/School/vg2/borg/borg.h +++ b/School/vg2/borg/borg.h @@ -276,10 +276,11 @@ void getNeighborLED(LEDSelect* origin, byte origin_dir, LEDSelect* Result) void getRotNeighborLED(LEDSelect* origin, byte rot, LEDSelect* Result) { - if (ROTTODIR[origin->side][rot] == 255) + byte direction = ROTTODIR[origin->side][rot]; + if (direction == 255) return; - getNeighborLED(origin, ROTTODIR[origin->side][rot], Result); + getNeighborLED(origin, direction, Result); } bool setColor(LEDSelect selection, CRGB color, CRGB* leds)