Add check to see if player is in gang before getting Gang Faction

This commit is contained in:
TheMas3212 2022-01-05 21:41:04 +11:00
parent 538a440b7e
commit 860e77f109
No known key found for this signature in database
GPG Key ID: 62A173A4FDA683CA

@ -1182,7 +1182,7 @@ export function NetscriptSingularity(
); );
return false; return false;
} }
if (faction.name === player.getGangFaction().name) { if (player.inGang() && faction.name === player.getGangFaction().name) {
workerScript.log( workerScript.log(
"donateToFaction", "donateToFaction",
() => `You can't donate to '${name}' because youre managing a gang for it`, () => `You can't donate to '${name}' because youre managing a gang for it`,