Skip to content

fix: flashbang blinds teammates/self when friendly fire is off (master)#839

Merged
Someone-193 merged 1 commit into
ExMod-Team:masterfrom
reversum:flashbang-teammate-ff-fix-master
May 31, 2026
Merged

fix: flashbang blinds teammates/self when friendly fire is off (master)#839
Someone-193 merged 1 commit into
ExMod-Team:masterfrom
reversum:flashbang-teammate-ff-fix-master

Conversation

@reversum
Copy link
Copy Markdown

@reversum reversum commented May 31, 2026

Description

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

Same fix as #838, targeted at master as requested (by Yamato) so it lands in the current
release line too.

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 (master) fix: flashbang blinds teammates/self when friendly fire is off (master) May 31, 2026
@Someone-193 Someone-193 merged commit 7626b1d into ExMod-Team:master May 31, 2026
6 checks passed
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.

2 participants