You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to add a component using GiveWeaponComponentToWeaponObject to a weapon object created with CreateWeaponObject after trying to add and remove a VARMOD component using GiveWeaponComponentToWeaponObject and RemoveWeaponComponentFromWeaponObject (and it not working?), it causes a native level exception to be thrown. The exception is the following:
I am unsure of how varmods work exactly, but it doesnt appear to be super well documented so this may well be a case of "not adding them correctly causes this exception". Either way, this seems funky and I don't think this should be happening.
Native exception should not be thrown. Instead, a more clear error indicating the issue (or no error at all?) should be shown.
Reproduction steps
Type /spawnweapon. This will create a weapon object (weapon_pistol) inside your ped (just walk forward to see it)
Type /addvarmod. You will see that it doesnt appear to do anything
Type /removevarmod. Again, this will appear to do nothing
Type /addsupp. This should add a suppressor to the pistol but doesnt. Instead, check F8 to observe the error thrown
Importancy
Slight inconvenience
Area(s)
FiveM, Natives, ScRT: Lua
Specific version(s)
FiveM, b2699
Additional information
Again, i am not sure whats so different about these varmods but they seem to cause some funky behaviour. They dont seem to work when trying to add them using the same method used to add non varmod components, and they also throw this native exception if you try and add them and then remove them from a weapon, and then try to add a standard component.
You will also notice that if you follow step 1 and 2, but then skip to step 4, the component again does NOT get added, but no exception is thrown. This suggests there's something funky going on when trying to remove the varmod component.
The text was updated successfully, but these errors were encountered:
Lxk3y
added
bug
triage
Needs a preliminary assessment to determine the urgency and required action
labels
May 7, 2024
I would just like to add that, if VARMODs work differently, some documentation on how exactly they differ from standard components would be much appreciated. As my repo steps show, they are definitely not working the same as standard components in some way when it comes to adding them to weapon objects.
What happened?
When trying to add a component using
GiveWeaponComponentToWeaponObject
to a weapon object created withCreateWeaponObject
after trying to add and remove a VARMOD component usingGiveWeaponComponentToWeaponObject
andRemoveWeaponComponentFromWeaponObject
(and it not working?), it causes a native level exception to be thrown. The exception is the following:I am unsure of how varmods work exactly, but it doesnt appear to be super well documented so this may well be a case of "not adding them correctly causes this exception". Either way, this seems funky and I don't think this should be happening.
Script to use for the reproduction scripts:
test_script.zip
Expected result
Native exception should not be thrown. Instead, a more clear error indicating the issue (or no error at all?) should be shown.
Reproduction steps
Importancy
Slight inconvenience
Area(s)
FiveM, Natives, ScRT: Lua
Specific version(s)
FiveM, b2699
Additional information
Again, i am not sure whats so different about these varmods but they seem to cause some funky behaviour. They dont seem to work when trying to add them using the same method used to add non varmod components, and they also throw this native exception if you try and add them and then remove them from a weapon, and then try to add a standard component.
You will also notice that if you follow step 1 and 2, but then skip to step 4, the component again does NOT get added, but no exception is thrown. This suggests there's something funky going on when trying to remove the varmod component.
The text was updated successfully, but these errors were encountered: