There is this fragment of code in my program: https://gitlab.com/tad-lispy/bevy-animated-sprite-playground/-/blob/e0be769dd5c81eecc9d6b1eddd93d3007f38b4cb/src/zombie.rs#L322-347.
As it is, it works correctly. There are 3 calls to the debug! macro. If I remove any of them it breaks with the following.
panicked at 'attempt to subtract with overflow', src/zombie.rs:335:29
It doesn't matter what the level is in the log settings (i.e. it works or breaks the same, even if the output is suppressed) or if the developer tools are closed (it's a web game). I can also replace debug! with info! or warn! with the same results.
The code is a bit convoluted and I intend to refactor it. Also I think I know where the logic bug is. My question is: what's up with logging influencing the logic so dramatically?