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 "KILL_ASSIST": {
playerStats.Enemies ??= [];
const enemyStatKey = {
KILL_ENEMY: "kills",
EXECUTE_ENEMY: "executions",
HEADSHOT: "headshots",
KILL_ASSIST: "assists"
}[category] as "kills" | "executions" | "headshots" | "assists";
const enemyStatKey = (
{
KILL_ENEMY: "kills",
EXECUTE_ENEMY: "executions",
HEADSHOT: "headshots",
KILL_ASSIST: "assists"
} as const
)[category];
for (const [type, count] of Object.entries(data as IUploadEntry)) {
const enemy = playerStats.Enemies.find(element => element.type === type);