mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-22 23:53:48 +01:00
Fixes 1862 Combat gang members can do hacking tasks via API and vice versa
This commit is contained in:
parent
fc888505ae
commit
c9f0c9c553
@ -194,6 +194,15 @@ export function NetscriptGang(player: IPlayer, workerScript: WorkerScript, helpe
|
||||
helper.updateDynamicRam("setMemberTask", getRamCost(player, "gang", "setMemberTask"));
|
||||
checkGangApiAccess("setMemberTask");
|
||||
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);
|
||||
if (success) {
|
||||
workerScript.log(
|
||||
|
Loading…
Reference in New Issue
Block a user