Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

inactive orders (amount = 0) have wrong price #116

Open
OrletSoir opened this issue May 30, 2019 · 0 comments
Open

inactive orders (amount = 0) have wrong price #116

OrletSoir opened this issue May 30, 2019 · 0 comments

Comments

@OrletSoir
Copy link

OrletSoir commented May 30, 2019

First spotted by Taki on slack:

When an order is inactive (amount: 0), the order's .price property when returned via Game.market.getOrderById is incorrect. It is smaller than the actual by a factor of 1000.

I've confirmed this and narrowed it down to the following code block:

getOrderById: register.wrapFn(function(id) {
const order = runtimeData.market.orders.all[id] || this.orders[id];
if(!order) {
return null;
}
const result = JSON.parse(JSON.stringify(order));
result.price /= 1000;
return result;

It attempts to fetch order from all orders, but inactive orders don't show up there, so instead it pulls it from your own orders (Game.market.orders), and then divides the order's price by 1000, however, in Game.market.orders the price is already processed, so the end result is price being dividied by 1000 twice, and inaccurate.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant