From e929d5d819fe711cc038d18f24507fb83b2ff17d Mon Sep 17 00:00:00 2001
From: Thomas Harte <thomas.harte@gmail.com>
Date: Sun, 3 May 2020 21:57:15 -0400
Subject: [PATCH] Ensures proper dereferencing of the std::optional.

---
 Components/OPL2/Implementation/EnvelopeGenerator.hpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Components/OPL2/Implementation/EnvelopeGenerator.hpp b/Components/OPL2/Implementation/EnvelopeGenerator.hpp
index 0f1566481..d4bb37426 100644
--- a/Components/OPL2/Implementation/EnvelopeGenerator.hpp
+++ b/Components/OPL2/Implementation/EnvelopeGenerator.hpp
@@ -44,7 +44,7 @@ template <int envelope_precision, int period_precision> class EnvelopeGenerator
 				case Phase::Damp:
 					update_decay(oscillator, 12);
 					if(attenuation_ == 511) {
-						will_attack_();
+						(*will_attack_)();
 						phase_ = Phase::Attack;
 					}
 				break;
@@ -118,7 +118,7 @@ template <int envelope_precision, int period_precision> class EnvelopeGenerator
 					return;
 				}
 
-				will_attack_();
+				(*will_attack_)();
 			}
 			phase_ = Phase::Attack;
 		}