From 6a88d7026d69aa266d43a40d1bb05cc770d0c531 Mon Sep 17 00:00:00 2001 From: ROllerozxa Date: Tue, 6 Aug 2024 18:23:20 +0200 Subject: [PATCH] Put Linear decay clamp fix behind new level version --- src/src/i1o1gate.cc | 6 ++++-- src/src/pkgman.hh | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/src/i1o1gate.cc b/src/src/i1o1gate.cc index 5bf77fea..ab20eafc 100644 --- a/src/src/i1o1gate.cc +++ b/src/src/i1o1gate.cc @@ -719,8 +719,10 @@ ldecay::solve_electronics() this->value = tclampf(this->value, 0.f, 1.f); this->value -= this->properties[0].v.f; - - this->value = tclampf(this->value, 0.f, 1.f); + + // BUG: Linear decay used to not clamp, keep buggy behaviour for old levels. + if (W->level.version >= LEVEL_VERSION_FUTURE) + this->value = tclampf(this->value, 0.f, 1.f); this->s_out[0].write(this->value); diff --git a/src/src/pkgman.hh b/src/src/pkgman.hh index 7fba8418..91443768 100644 --- a/src/src/pkgman.hh +++ b/src/src/pkgman.hh @@ -17,6 +17,7 @@ #define LEVEL_VERSION_1_5 28 #define LEVEL_VERSION_1_5_1 29 #define LEVEL_VERSION_2023_06_05 30 +#define LEVEL_VERSION_FUTURE 31 #define PKG_VERSION 3 #define LEVEL_VERSION LEVEL_VERSION_2023_06_05 @@ -57,7 +58,7 @@ static const char *level_version_strings[] = { "1.5", "1.5.1", "2023-06-05", - 0, + "31 (Pending)", 0, 0, 0,