Majiir / Kethane

Resource mining and processing plugin for Kerbal Space Program.
http://forum.kerbalspaceprogram.com/showthread.php/23979-Kethane
Other
117 stars 32 forks source link

TimeWarp fixedDelta for output rates in converter? #251

Closed markushaslinger closed 10 years ago

markushaslinger commented 10 years ago

While lurking trough the code I stumbled upon the line where the rates for the resources are calculated. I may be completely wrong, but shouldn't it be rate * (-1 * TimeWarp.fixedDeltaTime) for the output rates? The line has been introduced here https://github.com/Majiir/Kethane/commit/5a28ec5ba6e8d1a7abe75bcc597b403d48667971#diff-d74458a61116fd12165364aaa6c40798R131

Sorry if I didn't get it ;)

Majiir commented 10 years ago

It already is:

var rates = outputRates.Select(r => r * -1).Concat(inputRates).Select(r => r * TimeWarp.fixedDeltaTime).ToArray();

The output rates are negated (to make them actually outputs), then concatenated with the input rates (since all rates are treated the same), and then those are all multiplied by TimeWarp.fixedDeltaTime.

markushaslinger commented 10 years ago

Heck, my tired eyes missed that parenthesis, sorry again!