From 2f414e561644aca96ab15833c4847b7a4c3c5343 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Mon, 8 Dec 2025 21:24:37 +0000 Subject: [PATCH] Fix double XP counting in prestige system when users level up Adjusted the `prestigeUp` function in `aethex-bot/commands/prestige.js` to correctly update `total_xp_earned` and display values, preventing duplicate XP accumulation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: aed2e46d-25bb-4b73-81a1-bb9e8437c261 Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Event-Id: a792080b-bc3a-474f-8aa7-6dcea7ecb128 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/3bdfff67-975a-46ad-9845-fbb6b4a4c4b5/aed2e46d-25bb-4b73-81a1-bb9e8437c261/yTaZipL Replit-Helium-Checkpoint-Created: true --- .replit | 4 ++++ aethex-bot/commands/prestige.js | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.replit b/.replit index 5b6f647..3aa8355 100644 --- a/.replit +++ b/.replit @@ -22,6 +22,10 @@ externalPort = 80 localPort = 8080 externalPort = 8080 +[[ports]] +localPort = 35953 +externalPort = 3000 + [workflows] runButton = "Project" diff --git a/aethex-bot/commands/prestige.js b/aethex-bot/commands/prestige.js index f0e72d0..c685fa6 100644 --- a/aethex-bot/commands/prestige.js +++ b/aethex-bot/commands/prestige.js @@ -193,8 +193,7 @@ async function prestigeUp(interaction, supabase, client) { .from('user_profiles') .update({ xp: 0, - prestige_level: newPrestige, - total_xp_earned: totalEarned + currentXp + prestige_level: newPrestige }) .eq('id', link.user_id); @@ -216,7 +215,7 @@ async function prestigeUp(interaction, supabase, client) { .setDescription(`Congratulations! You are now **${newPrestigeInfo.name}**!\n\n**Rewards Unlocked:**\n${getNewRewards(newPrestige).join('\n')}`) .addFields( { name: 'XP Bonus', value: `+${xpBonus}%`, inline: true }, - { name: 'Total XP Earned (All Time)', value: (totalEarned + currentXp).toLocaleString(), inline: true } + { name: 'Total XP Earned (All Time)', value: totalEarned.toLocaleString(), inline: true } ) .setThumbnail(interaction.user.displayAvatarURL({ size: 256 })) .setTimestamp();