Skip to content

Commit 474b2df

Browse files
committed
Fix #718 incomplete table_bonus condition
1 parent 844cc44 commit 474b2df

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

src/app/components/FancyMenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export function FancyMenu({ placeholder, relative, class: clazz, getResults, chi
5353
}
5454
}, [setActive, inputRef])
5555

56-
return <div class={`px-1 ${relative ? 'relative' : ''}`}>
56+
return <div class={`${relative ? 'relative' : ''}`}>
5757
<div onClick={open}>
5858
{children}
5959
</div>

src/app/components/previews/LootTable.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,9 @@ const LootConditions: Record<string, (params: any) => LootCondition> = {
591591
},
592592
survives_explosion: () => () => true,
593593
table_bonus: ({ chances }) => (ctx) => {
594+
if (!chances) {
595+
return false
596+
}
594597
const level = 0 // TODO: get enchantment level from tool
595598
const chance = chances[clamp(level, 0, chances.length - 1)]
596599
return ctx.random.nextFloat() < chance

src/app/components/previews/LootTable1204.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,6 +476,9 @@ const LootConditions: Record<string, (params: any) => LootCondition> = {
476476
},
477477
survives_explosion: () => () => true,
478478
table_bonus: ({ chances }) => (ctx) => {
479+
if (!chances) {
480+
return false
481+
}
479482
const level = 0 // TODO: get enchantment level from tool
480483
const chance = chances[clamp(level, 0, chances.length - 1)]
481484
return ctx.random.nextFloat() < chance

src/styles/global.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ nav li {
184184
display: flex;
185185
align-items: center;
186186
cursor: pointer;
187-
margin: 0 16px;
187+
margin: 0 12px;
188188
fill: var(--nav);
189189
user-select: none;
190190
-webkit-user-select: none;

0 commit comments

Comments
 (0)