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.
First spotted by Taki on slack:
When an order is inactive (
amount: 0), the order's.priceproperty when returned viaGame.market.getOrderByIdis 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:
engine/src/game/market.js
Lines 41 to 48 in d1d78f3
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'spriceby1000, however, inGame.market.ordersthepriceis already processed, so the end result ispricebeing dividied by 1000 twice, and inaccurate.