From 6b8a91a23bd6f13ca431d8647132508c6bc58398 Mon Sep 17 00:00:00 2001 From: Alain Bryden <2285037+alainbryden@users.noreply.github.com> Date: Mon, 22 Nov 2021 11:19:23 -0400 Subject: [PATCH] Return the price paid/recieved on short/sellShort --- src/NetscriptFunctions/StockMarket.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NetscriptFunctions/StockMarket.ts b/src/NetscriptFunctions/StockMarket.ts index 1fc88de61..2e1b72bd0 100644 --- a/src/NetscriptFunctions/StockMarket.ts +++ b/src/NetscriptFunctions/StockMarket.ts @@ -151,7 +151,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript const stock = getStockFromSymbol(symbol, "short"); const res = shortStock(stock, shares, workerScript, {}); - return res ? stock.price : 0; + return res ? stock.getBidPrice() : 0; }, sellShort: function (symbol: any, shares: any): any { helper.updateDynamicRam("sellShort", getRamCost("stock", "sellShort")); @@ -167,7 +167,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript const stock = getStockFromSymbol(symbol, "sellShort"); const res = sellShort(stock, shares, workerScript, {}); - return res ? stock.price : 0; + return res ? stock.getAskPrice() : 0; }, placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any { helper.updateDynamicRam("placeOrder", getRamCost("stock", "placeOrder"));