forked from OpenWF/SpaceNinjaServer
fix: ensure guild advertisments vendor always has its 5 offers (#2078)
Because the per-bin limits are not respected right now, it was possible that some clan tiers simply don't have an offer some weeks. Reviewed-on: OpenWF/SpaceNinjaServer#2078 Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com> Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
This commit is contained in:
parent
52c8802d57
commit
a622787500
@ -207,7 +207,12 @@ const generateVendorManifest = (vendorInfo: IGeneratableVendorInfo): IVendorMani
|
|||||||
const rng = new SRng(mixSeeds(vendorSeed, cycleIndex));
|
const rng = new SRng(mixSeeds(vendorSeed, cycleIndex));
|
||||||
const manifest = ExportVendors[vendorInfo.TypeName];
|
const manifest = ExportVendors[vendorInfo.TypeName];
|
||||||
const offersToAdd = [];
|
const offersToAdd = [];
|
||||||
if (manifest.numItems && !manifest.isOneBinPerCycle) {
|
if (
|
||||||
|
manifest.numItems &&
|
||||||
|
(manifest.numItems.minValue != manifest.numItems.maxValue ||
|
||||||
|
manifest.items.length != manifest.numItems.minValue) &&
|
||||||
|
!manifest.isOneBinPerCycle
|
||||||
|
) {
|
||||||
const numItemsTarget = rng.randomInt(manifest.numItems.minValue, manifest.numItems.maxValue);
|
const numItemsTarget = rng.randomInt(manifest.numItems.minValue, manifest.numItems.maxValue);
|
||||||
while (processed.ItemManifest.length + offersToAdd.length < numItemsTarget) {
|
while (processed.ItemManifest.length + offersToAdd.length < numItemsTarget) {
|
||||||
// TODO: Consider per-bin item limits
|
// TODO: Consider per-bin item limits
|
||||||
|
Loading…
x
Reference in New Issue
Block a user