Skip to content

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

Description

@OrletSoir

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions