sealedWeaponContainer - Get random weapon preset if default preset not found
This commit is contained in:
parent
4c1884fda3
commit
89ab3a99a8
@ -279,10 +279,16 @@ export class LootGenerator
|
||||
}
|
||||
|
||||
// Get weapon preset - default or choose a random one from all possible
|
||||
const chosenWeaponPreset = containerSettings.defaultPresetsOnly
|
||||
let chosenWeaponPreset = containerSettings.defaultPresetsOnly
|
||||
? this.presetHelper.getDefaultPreset(chosenWeaponTpl)
|
||||
: this.randomUtil.getArrayValue(this.presetHelper.getPresets(chosenWeaponTpl));
|
||||
|
||||
if (!chosenWeaponPreset)
|
||||
{
|
||||
this.logger.warning(`Default preset for weapon ${chosenWeaponTpl} not found, choosing random instead`);
|
||||
chosenWeaponPreset = this.randomUtil.getArrayValue(this.presetHelper.getPresets(chosenWeaponTpl));
|
||||
}
|
||||
|
||||
// Add preset to return object
|
||||
itemsToReturn.push({
|
||||
count: 1,
|
||||
|
Loading…
x
Reference in New Issue
Block a user