-
-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect substraction from in stock or demand when using +10% or -10% buttons from station's lobby #5585
Comments
Selling fuel reducing demand is correct, and is intentional to prevent market simulation exploits. Buying fuel from the market should not increase the amount of fuel in stock though, will look into that. |
@Web-eWorks My bad. Buying fuel correctly substracts it from in stock. But what's wrong is that for example, I have Coronatrix with 23t of fuel. I sell it using -10% button. This will substract 3t of fuel from my ship, but will substract 2t from demand instead of 3t(23t from my ship - 10% = 2,3). Same issue with +10% button, if for example I buy fuel using this button and it adds 2t of fuel to my ship, it will substract 3t of fuel from in stock(18t from my ship + 10% = 1,8). |
This is most likely caused by an incorrect fractional value of stock being passed to |
@Web-eWorks
Accepted answer by Guffa(albeit it's for javascript, but works the same way) |
Good find. If you're interested in hacking pioneer's code, this is a good first pull request to learn the process. If not, we can push the fix. |
I'll try to do that. |
Fix for this issue pioneerspacesim#5585
Observed behaviour
Selling or buying fuel in station's lobby using +10% or -10% buttons incorectly substracts it from in stock or demand respectively. For example, when I sell 3t of fuel it will subtract 2t from demand, and when buying 2t of fuel, it will substract 3t from in stock.
Expected behaviour
Selling fuel and buying fuel should correctly substract corresponding columns.
Steps to reproduce
My pioneer version (and OS):
Latest master build (ac06900) (Windows 10 x64)
The text was updated successfully, but these errors were encountered: