Merge pull request #1763 from alainbryden/patch-1

Return the price paid/recieved on short/sellShort
This commit is contained in:
hydroflame 2021-11-25 11:36:59 -05:00 committed by GitHub
commit 8ad7ca5136
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -151,7 +151,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript
const stock = getStockFromSymbol(symbol, "short"); const stock = getStockFromSymbol(symbol, "short");
const res = shortStock(stock, shares, workerScript, {}); const res = shortStock(stock, shares, workerScript, {});
return res ? stock.price : 0; return res ? stock.getBidPrice() : 0;
}, },
sellShort: function (symbol: any, shares: any): any { sellShort: function (symbol: any, shares: any): any {
helper.updateDynamicRam("sellShort", getRamCost("stock", "sellShort")); helper.updateDynamicRam("sellShort", getRamCost("stock", "sellShort"));
@ -167,7 +167,7 @@ export function NetscriptStockMarket(player: IPlayer, workerScript: WorkerScript
const stock = getStockFromSymbol(symbol, "sellShort"); const stock = getStockFromSymbol(symbol, "sellShort");
const res = sellShort(stock, shares, workerScript, {}); 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 { placeOrder: function (symbol: any, shares: any, price: any, type: any, pos: any): any {
helper.updateDynamicRam("placeOrder", getRamCost("stock", "placeOrder")); helper.updateDynamicRam("placeOrder", getRamCost("stock", "placeOrder"));