mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-28 03:47:03 +02:00
CORPORATION: Use accounting methods for all funds transactions (#949)
This commit is contained in:
@@ -15,21 +15,21 @@ const bigNumber = 1e27;
|
||||
export function CorporationDev(): React.ReactElement {
|
||||
function addTonsCorporationFunds(): void {
|
||||
if (Player.corporation) {
|
||||
Player.corporation.funds = Player.corporation.funds + bigNumber;
|
||||
Player.corporation.gainFunds(bigNumber, "force majeure");
|
||||
}
|
||||
}
|
||||
|
||||
function modifyCorporationFunds(modify: number): (x: number) => void {
|
||||
return function (funds: number): void {
|
||||
if (Player.corporation) {
|
||||
Player.corporation.funds += funds * modify;
|
||||
Player.corporation.gainFunds(funds * modify, "force majeure");
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function resetCorporationFunds(): void {
|
||||
if (Player.corporation) {
|
||||
Player.corporation.funds = Player.corporation.funds - Player.corporation.funds;
|
||||
Player.corporation.loseFunds(Player.corporation.funds, "force majeure");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user