-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Friendly fire update #33
Conversation
welcome back😉 |
@@ -89,17 +89,18 @@ public static bool CheckFriendlyFirePlayerRules(Footprint attackerFootprint, Ref | |||
|
|||
// Return false, no custom friendly fire allowed, default to NW logic for FF. No point in processing if FF is enabled across the board. | |||
if (Server.FriendlyFire) | |||
return HitboxIdentity.IsEnemy(attackerFootprint.Role, victimHub.roleManager.CurrentRole.RoleTypeId); | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused, if FriendlyFire has been set to true, why return false?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes to NW logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code's behavior is, if true, we are doing custom FF logic, do not use NW logic. If false, we're not using custom ff logic, or we got to the end and we didn't find any rules we could follow, for safety, return false and use NW logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Goes to NW logic
Well iirc when FriendlyFire is false, the client doesn't even send the damage message to the server when both players are in the same team. So it wouldn't really work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that
HitboxIdentity.IsDamageable
is not used in the Flashbang event, the ProcessEvent method mentioned above is used,What's the reason why it's not used
In that Flashbang patch, the codes for adding targets in base game are skipped
I can see that, what I meant was, why
legacy code moment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2 it is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Option 2 it is?
if you put option 2 don't use Footprint:Hub but Footprint:Role that very important for things like grenade when you get your rôle changed (i don't really get the difference between all the option but that very important to not use ReferenceHub here)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
thanks and even if you choose an other option still does this change :3 because it's needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That 100% sure
EXILED/Exiled.Events/Patches/Events/Map/ExplodingFlashGrenade.cs
Outdated
Show resolved
Hide resolved
7d800aa
to
45de252
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am scared if this contains bug
Don't merge then - wait for a tester. I'm in no rush to have this merged or I'll close it and you can use x3rt solution |
i will wait for testing |
i tested, works with NPC |
Description
Describe the changes
What is the current behavior? (You can also link to an open issue here)
When the server has Friendly Fire enabled, CheckFriendlyFirePlayerRules returns false if two players are on the same team.
What is the new behavior? (if this is a feature change)
When the server has Friendly Fire enabled, default to NW logic to handle behavior.
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No.
Other information:
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other
I have no intention on a full possible combo test
¯\_(ツ)_/¯