EXILED icon indicating copy to clipboard operation
EXILED copied to clipboard

SetAmmo&CategoryLimit

Open louis1706 opened this issue 10 months ago • 3 comments

louis1706 avatar Apr 17 '24 17:04 louis1706

Maybe add XML for AddOperation?

VALERA771 avatar Apr 22 '24 09:04 VALERA771

Maybe add XML for AddOperation?

i just haven't got the time for it rn

louis1706 avatar Apr 22 '24 15:04 louis1706

Fix french comments

No worries not finished pr

louis1706 avatar May 10 '24 15:05 louis1706

@louis1706 is this ready for review ?

Misfiy avatar May 21 '24 15:05 Misfiy

No idea

louis1706 avatar May 21 '24 16:05 louis1706

Fixed some stuff but

                             System.Reflection.TargetException: Object does not match target type.
                               at System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00024] in <75633565436c42f0a6426b33f0132ade>:0
                               at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) [0x00000] in <75633565436c42f0a6426b33f0132ade>:0
                               at Exiled.API.Extensions.MirrorExtensions.AddOperation[T] (Mirror.SyncList`1[T] synclist, Mirror.SyncList`1+Operation[T] op, System.Int32 itemIndex, T oldItem, T newItem, System.Boolean checkAccess) [0x00005] in <08fb87aec36d49e9bf960e3df1b821f7>:0
                               at Exiled.API.Features.Player.SetAmmoLimit (Exiled.API.Enums.AmmoType ammotype, System.UInt16 value) [0x0005f] in <08fb87aec36d49e9bf960e3df1b821f7>:0

Misfiy avatar Jun 24 '24 00:06 Misfiy

Spent 6 hours on this, cannot get it working If someone else is able to do so go ahead, but I am unable

For anyone fixing it SyncList<T>[index] = newItem might be useful

Misfiy avatar Jun 25 '24 06:06 Misfiy

note: no error anymore but we need to send the synclist to only one player and not update to the server

IkaOverride avatar Jun 30 '24 12:06 IkaOverride

I just thought: if we set a limit for one ammo/category, a list for all other will be created and it means armor will not work anymore for every ammo/category?

IkaOverride avatar Jul 01 '24 01:07 IkaOverride

breaking change : GetAmmoLimit and GetCategoryLimit both take the bool parameter "ignoreArmor" fix : Categories that used to return -1 when getting their limit now return 1 (the real limit)

IkaOverride avatar Jul 02 '24 00:07 IkaOverride