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
@@ -111,6 +111,9 @@ static void __fastcall hook_iground_award_assists(uint8_t *victim)
|
||||
orig_iground_award_assists(victim);
|
||||
|
||||
if (local_mp_is_host() && victim != NULL && arr != NULL && count > 0) {
|
||||
uint32_t post_count = *(uint32_t *)(victim + LMP_IGM_OFF_OFFENDERS_CNT);
|
||||
if (post_count < count)
|
||||
count = post_count;
|
||||
arr = *(uint8_t **)(victim + LMP_IGM_OFF_OFFENDERS_PTR);
|
||||
for (i = 0; arr != NULL && i < count; i++) {
|
||||
uint8_t *off = arr + i * LMP_OFFENDER_STRIDE;
|
||||
|
||||
Reference in new issue
Block a user