feat!: Add overloads for AddItem using AttachmentName - #811
feat!: Add overloads for AddItem using AttachmentName#811Unbistrackted wants to merge 19 commits into
Conversation
Added check inside of ``Firearm::AddAttachment`` to prevent missmatches Added overload methods for ``Player`` when giving weapon with attachments using ``AttachmentName`` Fixed ``AttachmentIdentifier.TryParse`` giving wrong attachment by creating another overload that takes the weapon type
Someone-193
left a comment
There was a problem hiding this comment.
PR generally looks good, I just have a few nitpicks here and there. Just to confirm, you haven't removed or significantly changed any important methods right? Just making sure for Exiled 10 I don't get pinged with people being mad they cant find a method that used to exist lol
The only thing I can see ppl being upset is the I mean |
|
Also do you know if a method for getting the |
|
As I understand it, this pull request turned out to be quite complex if you're still making changes. When you made your solution, I immediately pointed out that it still had issues, but you didn't believe me, pointing out my supposed incompetence. |
no it's not complex, and I don't think we are doing any more change + Yes the bug is fixed, as I said in some early comments, you should not create attachments by their id, which is exactly what you are doing instead of using the attachment name I'm not quite sure what's your issue, but the pr isn't merged yet cause Exiled 10 will take while, so there's literally no rush
|
|
Just create a class that has the FirearmType and a list of AttachmentName, and parse based on that You don't need the entire AttachmentIdentifier to add it to the firearm |
|
Also forgot to say, AttachmentIdentifier wasn't "parsing" before cause, as I said, the collection that has them is populated some time after the plugins load Next time, instead of feeling offended, pay more attention to what I actually had to say |
Description
Describe the changes
Added check inside of
Firearm::AddAttachmentto prevent missmatchesAdded overload methods for
Playerwhen giving weapon with attachments usingAttachmentNameFixed
AttachmentIdentifier.TryParsegiving wrong attachment by creating another overload that takes the weapon typeWhat is the current behavior? (You can also link to an open issue here)
AttachmentIdentifier.TryParsegives wrong AttachmentIdentifier for certain weapons due to them having the same attachment name with different codesWhat 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:
Moved some of the methods to be closer to each other so it's easy to find
Props to @PUDGE133 for finding the bug
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other