Mercurial > public > ostc4
diff Discovery/Src/t7.c @ 177:458f16cda15c
Merged in janlmulder/ostc4/max-depth (pull request #3)
Bugfix: make max depth move with current depth
Approved-by: heinrichsweikamp <bitbucket@heinrichsweikamp.com>
author | heinrichsweikamp <bitbucket@heinrichsweikamp.com> |
---|---|
date | Tue, 12 Mar 2019 15:04:19 +0000 |
parents | ecb71521d004 |
children | d36596281501 |
line wrap: on
line diff
--- a/Discovery/Src/t7.c Sun Mar 10 20:30:42 2019 +0100 +++ b/Discovery/Src/t7.c Tue Mar 12 15:04:19 2019 +0000 @@ -2012,26 +2012,7 @@ } /* depth */ - float depth = 0; - float depthThisCall = unit_depth_float(stateUsed->lifeData.depth_meter); - if(is_stateUsedSetToSim()) - { - depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2] + depthLastCall[3] + depthLastCall[4] + depthLastCall[5] + depthLastCall[6] + depthLastCall[7] + depthLastCall[8]) / 10.0f; - - idDepthLastCall++; - if(idDepthLastCall >= 9) - idDepthLastCall = 0; - depthLastCall[idDepthLastCall] = depthThisCall; - } - else - { - depth = (depthThisCall + depthLastCall[0] + depthLastCall[1] + depthLastCall[2]) / 4.0f; - - idDepthLastCall++; - if(idDepthLastCall >= 3) - idDepthLastCall = 0; - depthLastCall[idDepthLastCall] = depthThisCall; - } + float depth = unit_depth_float(stateUsed->lifeData.depth_meter); if(depth <= 0.3f) depth = 0;