# HG changeset patch
# User Jan Mulder <jan@jlmulder.nl>
# Date 1650567770 -7200
# Node ID 05cdd367dbd0f0278f23a410e64888950cbb5910
# Parent  1953cd9145b3997ecdd1484b3094c2281bccdf98
Bugfix: deco planner did not initialize properly

Redoing a deco calculation in the planner, after a change in used gasses, did result
in wrong gas usage figures. And a restart after sleep made things right again. This all
feels like some initialization problem. Nothing very important as it's only a desktop
planner, but a bug it is.

Code reading, I found the not correctly initialized data.

Reported-by: Teun (forum user tdewilt2)
Signed-off-by: Jan Mulder <jan@jlmulder.nl>

diff -r 1953cd9145b3 -r 05cdd367dbd0 Discovery/Src/simulation.c
--- a/Discovery/Src/simulation.c	Wed Apr 20 20:25:04 2022 +0200
+++ b/Discovery/Src/simulation.c	Thu Apr 21 21:02:50 2022 +0200
@@ -391,6 +391,9 @@
 {
     uint8_t ptrGasChangeList = 0; // new hw 160704
 
+    for (int i = 0; i < 40; i++)
+    	gasChangeListDepthGas20x2[i] = 0;
+
     SDiveState * pDiveState = &stateSim;
     copyDiveSettingsToSim();
     vpm_init(&pDiveState->vpm,  pDiveState->diveSettings.vpm_conservatism, 0, 0);