fix #3395 donating to special factions possible via singularity

This commit is contained in:
TheMas3212 2022-04-15 01:32:18 +10:00
parent 68ddf1d588
commit 89baba2e24
No known key found for this signature in database
GPG Key ID: 62A173A4FDA683CA

@ -49,6 +49,7 @@ import { FactionInfos } from "../Faction/FactionInfo";
import { InternalAPI, NetscriptContext } from "src/Netscript/APIWrapper";
import { BlackOperationNames } from "../Bladeburner/data/BlackOperationNames";
import { enterBitNode } from "../RedPill";
import { FactionNames } from "../Faction/data/FactionNames";
export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript): InternalAPI<ISingularity> {
const getAugmentation = function (_ctx: NetscriptContext, name: string): Augmentation {
@ -1168,6 +1169,13 @@ export function NetscriptSingularity(player: IPlayer, workerScript: WorkerScript
);
return false;
}
if (faction.name === FactionNames.ChurchOfTheMachineGod || faction.name === FactionNames.Bladeburners) {
workerScript.log(
"donateToFaction",
() => `You can't donate to '${facName}' because they do not accept donations`,
);
return false;
}
if (typeof amt !== "number" || amt <= 0 || isNaN(amt)) {
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
return false;