From a6c576c1bafaaaa7f1bd9c98ff1589bf8d5fae34 Mon Sep 17 00:00:00 2001 From: Keyinator Date: Tue, 17 Dec 2024 15:51:58 +0000 Subject: [PATCH] feat(clcore): Allow iteration of WeaponCollection --- code/client/clrcore/External/WeaponCollection.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/client/clrcore/External/WeaponCollection.cs b/code/client/clrcore/External/WeaponCollection.cs index 3cf11c95f5..25108c36bf 100644 --- a/code/client/clrcore/External/WeaponCollection.cs +++ b/code/client/clrcore/External/WeaponCollection.cs @@ -10,7 +10,7 @@ namespace CitizenFX.FiveM namespace CitizenFX.Core #endif { - public sealed class WeaponCollection + public sealed class WeaponCollection : IEnumerable { #region Fields Ped _owner; @@ -22,6 +22,14 @@ internal WeaponCollection(Ped owner) _owner = owner; } + public IEnumerator GetEnumerator() + { + foreach (Weapon weapon in _weapons.Values) + { + yield return weapon; + } + } + public Weapon this[WeaponHash hash] { get