Skip to content

fix: flashbang blinds teammates/self when friendly fire is off#838

Open
reversum wants to merge 1 commit into
ExMod-Team:devfrom
reversum:flashbang-teammate-ff-fix
Open

fix: flashbang blinds teammates/self when friendly fire is off#838
reversum wants to merge 1 commit into
ExMod-Team:devfrom
reversum:flashbang-teammate-ff-fix

Conversation

@reversum
Copy link
Copy Markdown

Description

Describe the changes
Fixes an inverted condition in ExplodingFlashGrenade.ProcessEvent that let
flashbangs blind teammates even when friendly fire is disabled.

What is the current behavior?
The teammate skip checks instance.PreviousOwner.LifeIdentifier == player.Footprint.LifeIdentifier.
UniqueLifeIdentifier is a global per-life counter, so that only matches when
player is the thrower himself, never a teammate. The continue therefore
never runs for teammates and they get flashed with FF off.

This came from inlining the old !instance.PreviousOwner.CompareLife(player.ReferenceHub)
check. CompareLife is LifeIdentifier == other...UniqueLifeIdentifier, so the
rewrite dropped the negation and turned != into ==.

What is the new behavior?
Flipped back to !=, so the condition is true for every teammate again and they
are correctly skipped. The LifeIdentifier comparison stays in place, so the
NW #2811 fix intent is preserved.

Does this PR introduce a breaking change?
No.

Other information:
One-character logic fix, only affects flashbang targeting while Server.FriendlyFire is off.


Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentations

Submission checklist

  • I have checked the project can be compiled
  • I have tested my changes and it worked as expected

Patches (if there are any changes related to Harmony patches)

  • I have checked no IL patching errors in the console

Other

  • Still requires more testing

The LifeIdentifier check that was added for NW bug #2811 inlined the
old `!PreviousOwner.CompareLife(player.ReferenceHub)` condition but
dropped the negation, turning `!=` into `==`.

UniqueLifeIdentifier is a global per-life counter, so it only matches
when `player` is the thrower himself, never for teammates. With `==`
the second half of the condition is false for every teammate, the
`continue` never runs, and they all get flashed even with FF disabled.

Flipping it back to `!=` restores the teammate skip while keeping the
LifeIdentifier intent for the NW fix.
@reversum reversum changed the title fix: flashbang blinds teammates when friendly fire is off fix: flashbang blinds teammates/self when friendly fire is off May 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant