Skip to content

Commit d93acbb

Browse files
committed
Fix rarity attribute assignment in postLootDrop function
1 parent 37ed143 commit d93acbb

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/service/lootDrop.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,8 @@ export async function postLootDrop(
175175
const rarityWeights = rarities.map(a => a.initialDropWeight ?? 0);
176176

177177
const rarityAttribute =
178-
(predefinedLootDropOptions?.rarity ?? template.id === LootKind.NICHTS)
179-
? null
180-
: randomEntryWeighted(rarities, rarityWeights);
178+
predefinedLootDropOptions?.rarity ??
179+
(template.id === LootKind.NICHTS ? null : randomEntryWeighted(rarities, rarityWeights));
181180

182181
const claimedLoot = await lootService.createLoot(
183182
template,

0 commit comments

Comments
 (0)