Closed FutureAIGuru closed 2 years ago
This is most likely because the engine speed is set to a constant value outside the 0 to 10 range when paused. Then when the engine is paused it becomes impossible to to find the true value when it would be running. If instead we set the speed to minus the running speed for a paused engine, we can still determine the speed (absolute of speed) and the state (positive=running, negative=paused).
Further investigation shows the speed is still written to the file, it just does not get initialized once the file is reloaded.
This good idea should be implemented as part of code cleanup event if it isn’t the specific cause of the issue.
The problem in the end was pushing and popping the engineDelay, which overwrote any speed changes between the two, so a loaded network would set delay correctly, only to be overwritten when the resume popped the previous delay. Now pop discards the value so it no longer wreaks havoc on the engine delay. Also, IsEngineSuspended() was created, which basically checks just the size of the stack. Fix has been committed.
Describe the bug See title
This used to work so it was likely introduced by my most recent suspend/resume "improvement".