mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-27 01:53:48 +01:00
Merge pull request #2354 from TheMas3212/fix-1862
Fixes 1862 Combat gang members can do hacking tasks via API and vice versa
This commit is contained in:
commit
ef3c7494cc
@ -194,6 +194,15 @@ export function NetscriptGang(player: IPlayer, workerScript: WorkerScript, helpe
|
|||||||
helper.updateDynamicRam("setMemberTask", getRamCost(player, "gang", "setMemberTask"));
|
helper.updateDynamicRam("setMemberTask", getRamCost(player, "gang", "setMemberTask"));
|
||||||
checkGangApiAccess("setMemberTask");
|
checkGangApiAccess("setMemberTask");
|
||||||
const member = getGangMember("setMemberTask", memberName);
|
const member = getGangMember("setMemberTask", memberName);
|
||||||
|
const gang = player.gang;
|
||||||
|
if (gang === null) throw new Error("Should not be called without Gang");
|
||||||
|
if (!gang.getAllTaskNames().includes(taskName)) {
|
||||||
|
workerScript.log(
|
||||||
|
"gang.setMemberTask",
|
||||||
|
() => `Failed to assign Gang Member '${memberName}' to Invalid task '${taskName}'. '${memberName}' is now Unassigned`,
|
||||||
|
);
|
||||||
|
return member.assignToTask('Unassigned');
|
||||||
|
}
|
||||||
const success = member.assignToTask(taskName);
|
const success = member.assignToTask(taskName);
|
||||||
if (success) {
|
if (success) {
|
||||||
workerScript.log(
|
workerScript.log(
|
||||||
|
Loading…
Reference in New Issue
Block a user