fix(stats): captures not being tracked for a new enemy #1728

Merged
Sainan merged 3 commits from captures into main 2025-04-19 09:04:22 -07:00
Showing only changes of commit 71c96f248d - Show all commits

View File

@ -137,12 +137,14 @@ export const updateStats = async (accountOwnerId: string, payload: IStatsUpdate)
case "HEADSHOT": case "HEADSHOT":
case "KILL_ASSIST": { case "KILL_ASSIST": {
playerStats.Enemies ??= []; playerStats.Enemies ??= [];
const enemyStatKey = { const enemyStatKey = (
{
KILL_ENEMY: "kills", KILL_ENEMY: "kills",
EXECUTE_ENEMY: "executions", EXECUTE_ENEMY: "executions",
HEADSHOT: "headshots", HEADSHOT: "headshots",
KILL_ASSIST: "assists" KILL_ASSIST: "assists"
}[category] as "kills" | "executions" | "headshots" | "assists"; } as const
)[category];
for (const [type, count] of Object.entries(data as IUploadEntry)) { for (const [type, count] of Object.entries(data as IUploadEntry)) {
const enemy = playerStats.Enemies.find(element => element.type === type); const enemy = playerStats.Enemies.find(element => element.type === type);