-
Notifications
You must be signed in to change notification settings - Fork 43
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
these are definitely weapons as well #167
base: dev
Are you sure you want to change the base?
Conversation
https://github.com/Mikihero/EXILED/blob/02daca40efaccf6974c7d85a7f5c977fa453e210/EXILED/Exiled.API/Extensions/ItemExtensions.cs#L42 |
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 wanted to write a joke but I'm too lazy
in my opinion we should added IsFirearm and put this one as Obsolete and for Exiled 9 doing this check with all possible Weapon if you guys thinks it's better to do it directly it's your choice |
I guess it could be useful for people who have no idea how to cast but the actual code would be just |
that was actually the only use case of this Propperty (they are more if you look under and above this one) |
not sure what you mean |
I mean that it would be good to have a replacement for what they were using until now so we can tell them what to replace IsWeapon with IsFirearm |
makes sense, I can do that later |
@@ -157,7 +157,7 @@ public ushort Serial | |||
/// <summary> | |||
/// Gets a value indicating whether or not this item is a weapon. | |||
/// </summary> | |||
public bool IsWeapon => this is Firearm; | |||
public bool IsWeapon => this is Firearm || Type is ItemType.Jailbird or ItemType.MicroHID; |
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.
public bool IsWeapon => this is Firearm || Type is ItemType.Jailbird or ItemType.MicroHID; | |
public bool IsWeapon => this is Firearm || Type is ItemType.Jailbird or ItemType.MicroHID; | |
/// <summary> | |
/// Gets a value indicating whether or not this item is a firearm. | |
/// </summary> | |
public bool IsFirearm => this is Firearm; |
Description
Describe the changes
What is the current behavior?
Item.IsWeapon
only checks for firearmsEXILED/EXILED/Exiled.API/Features/Items/Item.cs
Line 160 in 9cd0e45
What is the new behavior? Checks for Micro HID and jailbird as well as firearm
Does this PR introduce a breaking change? Technically yes, although I can't think of a use case where you wouldn't also want to include other weapons instead of just checking if it's a firearm.
Other information: As it technically is breaking, I was considering just making this a method (ideally a different property tho I culdn't think of a good name, hence a method of a similar name)
Types of changes
Submission checklist
Patches (if there are any changes related to Harmony patches)
Other