UI: Fixes #3132 several Sleeve can no longer works concurrently in the same company
This commit is contained in:
hydroflame 2022-07-21 02:27:59 -04:00 committed by GitHub
commit 8f7bbaf62c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -44,7 +44,7 @@ interface ITaskDetails {
function possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {
// Array of all companies that other sleeves are working at
const forbiddenCompanies = [];
const forbiddenCompanies: string[] = [];
for (const otherSleeve of player.sleeves) {
if (sleeve === otherSleeve) {
continue;
@ -54,13 +54,8 @@ function possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {
}
}
const allJobs: string[] = Object.keys(player.jobs);
for (let i = 0; i < allJobs.length; ++i) {
if (!forbiddenCompanies.includes(allJobs[i])) {
allJobs[i];
}
}
return allJobs;
return allJobs.filter((company) => !forbiddenCompanies.includes(company));
}
function possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {