Skip to content

Commit

Permalink
Merge pull request #1763 from alainbryden/patch-1
Browse files Browse the repository at this point in the history
Return the price paid/recieved on short/sellShort
  • Loading branch information
hydroflame authored Nov 25, 2021
2 parents afe6a72 + 6b8a91a commit 8ad7ca5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/NetscriptFunctions/StockMarket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
Expand All @@ -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"));
Expand Down

0 comments on commit 8ad7ca5

Please sign in to comment.