Skip to content

Commit

Permalink
fix: 🐛 tweak gram drops
Browse files Browse the repository at this point in the history
  • Loading branch information
lucca180 committed Feb 1, 2025
1 parent 5c97037 commit 30965ef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/Items/ItemDrops.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ const DropText = ({ pool, itemOpenable, isFirst }: DropTextProps) => {
const t = useTranslations();
const isGram = itemOpenable.isGram;

if (!pool || !pool.isChance) {
if (!pool || !pool.isChance || (isGram && !pool.isLE)) {
const openable = pool ?? itemOpenable;
const poolName = pool ? (pool.isLE ? 'le' : pool.name) : 'unknown';

Expand Down Expand Up @@ -294,7 +294,7 @@ const DropText = ({ pool, itemOpenable, isFirst }: DropTextProps) => {
);
}

if (pool.isChance) {
if (pool.isChance && (!isGram || pool.isLE)) {
if (pool.maxDrop > 1 && pool.maxDrop !== pool.minDrop)
return (
<>
Expand Down
7 changes: 7 additions & 0 deletions pages/api/v1/items/[id_name]/drops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ export const getItemDrops = async (
(!openableData.isChoice || pool.name === 'le')
)
pool.isChance = true;

if (pool.isLE) openableData.hasLE = true;
});

openableData.minDrop =
Expand All @@ -348,6 +350,10 @@ export const getItemDrops = async (
if (isGram) {
openableData.minDrop = 1;
openableData.maxDrop = 1;
Object.keys(openableData.pools).map((pool) => {
openableData.pools[pool].minDrop = 1;
openableData.pools[pool].maxDrop = 1;
});
}

Object.values(dropsData)
Expand Down Expand Up @@ -380,6 +386,7 @@ export const getItemDrops = async (
});

openableData.openings = confimedDrops.size;
console.log(openableData);
return openableData;
};

Expand Down

0 comments on commit 30965ef

Please sign in to comment.