mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-18 13:43:49 +01:00
fix Stock Initializer (#137)
* stock symbols initializer is called by stockmarket initializer * remove redundant second initStockMarketFn function
This commit is contained in:
parent
1d0d4f8da6
commit
19e8946d9a
@ -1,6 +1,6 @@
|
||||
import { Player as player } from "../Player";
|
||||
import { buyStock, sellStock, shortStock, sellShort } from "../StockMarket/BuyingAndSelling";
|
||||
import { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarketFn } from "../StockMarket/StockMarket";
|
||||
import { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarket } from "../StockMarket/StockMarket";
|
||||
import { getBuyTransactionCost, getSellTransactionGain } from "../StockMarket/StockMarketHelpers";
|
||||
import { OrderTypes } from "../StockMarket/data/OrderTypes";
|
||||
import { PositionTypes } from "../StockMarket/data/PositionTypes";
|
||||
@ -382,7 +382,7 @@ export function NetscriptStockMarket(): InternalAPI<TIX> {
|
||||
}
|
||||
|
||||
player.hasWseAccount = true;
|
||||
initStockMarketFn();
|
||||
initStockMarket();
|
||||
player.loseMoney(getStockMarketWseCost(), "stock");
|
||||
helpers.log(ctx, () => "Purchased WSE Account Access");
|
||||
return true;
|
||||
|
@ -19,7 +19,7 @@ import { LiteratureNames } from "./Literature/data/LiteratureNames";
|
||||
import { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from "./Server/AllServers";
|
||||
import { prestigeHomeComputer } from "./Server/ServerHelpers";
|
||||
import { SpecialServers } from "./Server/data/SpecialServers";
|
||||
import { deleteStockMarket, initStockMarket, initSymbolToStockMap } from "./StockMarket/StockMarket";
|
||||
import { deleteStockMarket, initStockMarket } from "./StockMarket/StockMarket";
|
||||
import { Terminal } from "./Terminal";
|
||||
|
||||
import { dialogBoxCreate } from "./ui/React/DialogBox";
|
||||
@ -142,7 +142,6 @@ export function prestigeAugmentation(): void {
|
||||
// Reset Stock market
|
||||
if (Player.hasWseAccount) {
|
||||
initStockMarket();
|
||||
initSymbolToStockMap();
|
||||
}
|
||||
|
||||
// Red Pill
|
||||
@ -278,7 +277,6 @@ export function prestigeSourceFile(flume: boolean): void {
|
||||
// Reset Stock market, gang, and corporation
|
||||
if (Player.hasWseAccount) {
|
||||
initStockMarket();
|
||||
initSymbolToStockMap();
|
||||
} else {
|
||||
deleteStockMarket();
|
||||
}
|
||||
|
@ -167,6 +167,7 @@ export function initStockMarket(): void {
|
||||
StockMarket.storedCycles = 0;
|
||||
StockMarket.lastUpdate = 0;
|
||||
StockMarket.ticksUntilCycle = TicksPerCycle;
|
||||
initSymbolToStockMap();
|
||||
}
|
||||
|
||||
export function initSymbolToStockMap(): void {
|
||||
@ -280,8 +281,3 @@ export function processStockPrices(numCycles = 1): void {
|
||||
stock.shareTxUntilMovement = Math.min(stock.shareTxUntilMovement + 10, stock.shareTxForMovement);
|
||||
}
|
||||
}
|
||||
|
||||
export function initStockMarketFn(): void {
|
||||
initStockMarket();
|
||||
initSymbolToStockMap();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user