Wow, that's pretty cool. Reproduced. Oil starts out normally and switches to negative not-a-number on hour one.
No idea how the hell this could have happened!
Investigating.
... Something I did with the way unit stockpiles are calculated in A02...
... Division stockpiles are being set to -NaN somehow, which then chains to their units and eventually the owning country...
A country without divisions is unaffected.
Aha, got it! Turns out that min/max operations are undefined on NaN, and divisions without oil produce that when dividing through their maximum stockpile.
Also, and that one is in equal parts on me and on Microsoft: chaining min and max together, it's very easy to accidentally swap their intended order; guess what happened. If only std::clamp were already implemented, oh Microsoft who you claim to be current in your C++17 support!
----
Fixed in A03.
No idea how the hell this could have happened!
Investigating.
... Something I did with the way unit stockpiles are calculated in A02...
... Division stockpiles are being set to -NaN somehow, which then chains to their units and eventually the owning country...
A country without divisions is unaffected.
Aha, got it! Turns out that min/max operations are undefined on NaN, and divisions without oil produce that when dividing through their maximum stockpile.
Also, and that one is in equal parts on me and on Microsoft: chaining min and max together, it's very easy to accidentally swap their intended order; guess what happened. If only std::clamp were already implemented, oh Microsoft who you claim to be current in your C++17 support!
----
Fixed in A03.
Last edited:
- 1