From: xangelo Date: Fri, 29 Sep 2023 18:32:18 +0000 (-0400) Subject: fix: count current dungeon run X-Git-Url: https://git.xangelo.ca/?a=commitdiff_plain;h=94bb4302bb3f2202de0f227fcde1f9041e1ba842;p=risinglegends.git fix: count current dungeon run Dungeon completion was triggered after the count of number of runs instead of before allowing users to get 1 extra run in. --- diff --git a/src/server/locations/dungeon.ts b/src/server/locations/dungeon.ts index 26f7460..2b45096 100644 --- a/src/server/locations/dungeon.ts +++ b/src/server/locations/dungeon.ts @@ -161,6 +161,7 @@ router.post('/city/dungeon/:dungeon_id/complete', authEndpoint, async (req, res) }); } + await completeDungeon(req.player.id); // if this is not the first completion, lets give them diminishing returns const completionsToday = await getEventHistoryToday(req.player.id, 'DUNGEON_COMPLETE'); @@ -179,7 +180,6 @@ router.post('/city/dungeon/:dungeon_id/complete', authEndpoint, async (req, res) } // delete the tracking for this dungeon-run - await completeDungeon(req.player.id); await updatePlayer(req.player); res.send(dungeonRewards(dungeon, rewards, completionsToday.length));