Skip to content

Conversation

@obvEve
Copy link
Member

@obvEve obvEve commented Nov 29, 2024

Description

Describe the changes
Fix

What is the current behavior? (You can also link to an open issue here)

What is the new behavior? (if this is a feature change)

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)

Other information:


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

// Only check friendlyFire if the FootPrint hasn't changed (Fix for Grenade not dealing damage because it's from a dead player)
// TODO rework FriendlyFireRule to make it compatible with Footprint
if (!attackerFootprint.Equals(new Footprint(attackerFootprint.Hub)))
if (!attackerFootprint.CompareLife(new Footprint(attackerFootprint.Hub)))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes grenades

if ((instance.transform.position - player.Position).sqrMagnitude >= distance)
continue;
if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.LifeIdentifier != new Footprint(referenceHub).LifeIdentifier)
if (!ExiledEvents.Instance.Config.CanFlashbangsAffectThrower && instance.PreviousOwner.CompareLife(player.ReferenceHub))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes flashbangs

{
List<Player> targetToAffect = ListPool<Player>.Pool.Get();
foreach (ReferenceHub referenceHub in ReferenceHub.AllHubs)
foreach (Player player in Player.List)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is technically better since we call Player.Get() immediately after

@Misaka-ZeroTwo Misaka-ZeroTwo merged commit 0a210ce into ExMod-Team:scpsl14 Nov 30, 2024
5 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