Skip to content
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

feat(clcore): Allow iteration of WeaponCollection #3014

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Keyinator
Copy link
Contributor

@Keyinator Keyinator commented Dec 17, 2024

Goal of this PR

Allows to iterate over WeaponCollection like:

foreach(Weapon weapon in Game.PlayerPed.Weapons)
{
    //Do something
}

How is this PR achieving the goal

Make WeaponCollection inherit IEnumerable<Weapon> and create the necessary function GetEnumerator()

This PR applies to the following area(s)

FiveM, ScRT: C#

Successfully tested on

Game builds:

Platforms:

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

@github-actions github-actions bot added ScRT: C# Issues/PRs related to either C# scripting runtimes triage Needs a preliminary assessment to determine the urgency and required action invalid Requires changes before it's considered valid and can be (re)triaged and removed triage Needs a preliminary assessment to determine the urgency and required action labels Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged ScRT: C# Issues/PRs related to either C# scripting runtimes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant