From 73578c6f18adb2a023fff9891d7139f09c6dc7a4 Mon Sep 17 00:00:00 2001 From: Steven Atkinson Date: Sat, 23 Nov 2024 00:08:35 -0800 Subject: [PATCH] Update Unserialization.cpp Fix bugs w/ `pos` --- NeuralAmpModeler/Unserialization.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/NeuralAmpModeler/Unserialization.cpp b/NeuralAmpModeler/Unserialization.cpp index 2c9cf6b9..0fd803ce 100644 --- a/NeuralAmpModeler/Unserialization.cpp +++ b/NeuralAmpModeler/Unserialization.cpp @@ -106,7 +106,6 @@ void _UpdateConfigFrom_0_7_12(nlohmann::json& config) int _GetConfigFrom_0_7_12(const iplug::IByteChunk& chunk, int startPos, nlohmann::json& config) { - int pos = startPos; std::vector paramNames{"Input", "Threshold", "Bass", @@ -120,7 +119,7 @@ int _GetConfigFrom_0_7_12(const iplug::IByteChunk& chunk, int startPos, nlohmann "InputCalibrationLevel", "OutputMode"}; - pos = _UnserializePathsAndExpectedKeys(chunk, pos, config, paramNames); + int pos = _UnserializePathsAndExpectedKeys(chunk, startPos, config, paramNames); // Then update: _UpdateConfigFrom_0_7_12(config); return pos; @@ -144,7 +143,7 @@ int _GetConfigFrom_0_7_10(const iplug::IByteChunk& chunk, int startPos, nlohmann { std::vector paramNames{ "Input", "Threshold", "Bass", "Middle", "Treble", "Output", "NoiseGateActive", "ToneStack", "OutNorm", "IRToggle"}; - int pos = _UnserializePathsAndExpectedKeys(chunk, pos, config, paramNames); + int pos = _UnserializePathsAndExpectedKeys(chunk, startPos, config, paramNames); // Then update: _UpdateConfigFrom_0_7_10(config); return pos;