feat: handle one player per job
This commit is contained in:
parent
1ca1519cc7
commit
fc5228eec6
|
@ -38,7 +38,7 @@
|
||||||
<PackageReference Include="DalamudPackager" Version="1.2.1" />
|
<PackageReference Include="DalamudPackager" Version="1.2.1" />
|
||||||
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
|
<PackageReference Include="Fody" Version="6.5.1" PrivateAssets="all" />
|
||||||
<PackageReference Include="ILMerge.Fody" Version="1.16.0" PrivateAssets="all" />
|
<PackageReference Include="ILMerge.Fody" Version="1.16.0" PrivateAssets="all" />
|
||||||
<PackageReference Include="XivCommon" Version="1.1.0" />
|
<PackageReference Include="XivCommon" Version="1.3.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -96,8 +96,29 @@ namespace BetterPartyFinder {
|
||||||
var wanted = filter.Jobs[idx];
|
var wanted = filter.Jobs[idx];
|
||||||
|
|
||||||
for (var i = 0; i < listing.SlotsAvailable; i++) {
|
for (var i = 0; i < listing.SlotsAvailable; i++) {
|
||||||
// if the slot isn't already full and the job can fit into it, add it to the set
|
// if the slot is already full or the job can't fit into it, skip
|
||||||
if (present[i] == 0 && slots[i][wanted]) {
|
if (present[i] != 0 || !slots[i][wanted]) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for one player per job
|
||||||
|
if (listing[SearchAreaFlags.OnePlayerPerJob]) {
|
||||||
|
// make sure at least one job in the wanted set isn't taken
|
||||||
|
foreach (var possibleJob in (JobFlags[]) Enum.GetValues(typeof(JobFlags))) {
|
||||||
|
if (!wanted.HasFlag(possibleJob)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var job = possibleJob.ClassJob(this.Plugin.Interface.Data);
|
||||||
|
if (present.Contains((byte) job.RowId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
jobs[idx].Add(i);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// not one player per job
|
||||||
jobs[idx].Add(i);
|
jobs[idx].Add(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue