fix(battle): ignore non-player kills for firstKill and clamp assist loop
Ignore HUD kill feed entries with killer == -1 (mission air defense SAM/AAA and NPC units, common in Nuclear Escalation) when awarding firstKill, matching avengeAwards. Also re-read the offenders vector count after orig_iground_award_assists in local_mp_events.c so the post-call scan never reads past a shrunk array. Verified with root typecheck, MSVC x64 wto_ws.dll rebuild (0 warnings in project C code), and a runnable streak check.
This commit is contained in:
1 parent
480496ca93
commit
194417a388
2 files changed
+5
-1
No files matched your search
@@ -175,7 +175,8 @@ export function evaluateStreaks(definitions: readonly StreakDefinition[], facts:
|
||||
for (const time of facts.nuclearStrikes) award(def, time, 1);
|
||||
break;
|
||||
case 'firstKill': {
|
||||
const first = facts.feed.find((k) => k.killerTeam !== k.victimTeam);
|
||||
// Ignore non-player mission units (air defense SAM/AAA, NPCs) whose HUD feed killer id is -1.
|
||||
const first = facts.feed.find((k) => k.killer >= 0 && k.killerTeam !== k.victimTeam);
|
||||
if (first && first.killer === facts.localPlayerId) award(def, first.time, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user