mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
Merge pull request #2353 from TheMas3212/fix-1860
Fix 1860 donate to gang faction possible via singularity
This commit is contained in:
commit
74ef8994bb
@ -1175,7 +1175,20 @@ export function NetscriptSingularity(
|
|||||||
helper.updateDynamicRam("donateToFaction", getRamCost(player, "donateToFaction"));
|
helper.updateDynamicRam("donateToFaction", getRamCost(player, "donateToFaction"));
|
||||||
helper.checkSingularityAccess("donateToFaction");
|
helper.checkSingularityAccess("donateToFaction");
|
||||||
const faction = getFaction("donateToFaction", name);
|
const faction = getFaction("donateToFaction", name);
|
||||||
|
if (!player.factions.includes(faction.name)) {
|
||||||
|
workerScript.log(
|
||||||
|
"donateToFaction",
|
||||||
|
() => `You can't donate to '${name}' because you aren't a member`,
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (player.inGang() && faction.name === player.getGangFaction().name) {
|
||||||
|
workerScript.log(
|
||||||
|
"donateToFaction",
|
||||||
|
() => `You can't donate to '${name}' because youre managing a gang for it`,
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
if (typeof amt !== "number" || amt <= 0) {
|
if (typeof amt !== "number" || amt <= 0) {
|
||||||
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
|
workerScript.log("donateToFaction", () => `Invalid donation amount: '${amt}'.`);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user