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
Describe the bug
If you add an LCP adding a frame on higher License Level than the other itens (weapons, systems, mods) for this frame's license, the console throws the following error message:
ERROR: Cannot read properties of undefined (reading 'unshift')
To Reproduce
Steps to reproduce the behavior:
Create an LCP with a new frame on LL2 (tested on HA, but should have the same behavior on any Manufacturer) and any item on LL1 for that frame (tested with system and with mod, both at the same time and individually)
Manage Content --> Install Content --> Select your test .lcp file --> Install
Console should pop-up the error message
Close the Manage Content Packs modal
Try opening any license (including core licenses). Same result on level up, tactical profile or compendium.
Expected behavior
Best behavior: All licenses load successfully.
Good behavior: All core licenses and licenses from other LCPs load successfully, with an error message only affecting the licenses from the .lcp
Screenshots
Desktop:
OS: Windows 11 Pro
Version 23H2 (OS Build 22631.4249)
Browser: Microsoft Edge
Version 129.0.2792.65 (Official build) (64-bit)
Additional context
LCPs with the frame on any LL with no itens loads correctly.
LCPs with the frame and at least one item on the same LL as the frame also load correctly.
Though the error message wasn't very helpful, looking at the src/classes/pilot/components/license/License.ts file through DevTools, at line 44 it defines the const max. If there is no item on the frame, it defaults max to frame.LicenseLevel, but if there is any item it defines max as the highest LL required to unlock the item (if multiple itens, the highest LL in the array).
Notably, it doesn't count the frame as an item, so if you have a system on LL1 and the frame on LL2 it will look through the array of itens (only 1 system) and get the highest LL to unlock it, in this case 1.
Later on, it defines Unlocks based on max.
And finally, at line 57 it tries to this.Unlocks[frame.LicenseLevel - 1].unshift(frame) and throws the error.
Workaround
Create a placeholder item on the same LL as the frame.
Haven't tested at a level above, but should work too.
Suggestions
To make this kind of LCP load, I'd suggest setting the max based on the higher of the 2 figures, between higher LL required for itens and LL for the frame, rather than only looking at the LL for the frame when there are no itens.
To make the rest of the licenses still load, even with a "bad" LCP, I haven't checked the code, but I'd guess the catch exception is stopping the return of the function, so maybe i different way of handling exceptions should fix that. Will try to look at it at a later date and edit the suggestion.
The text was updated successfully, but these errors were encountered:
Describe the bug
If you add an LCP adding a frame on higher License Level than the other itens (weapons, systems, mods) for this frame's license, the console throws the following error message:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Best behavior: All licenses load successfully.
Good behavior: All core licenses and licenses from other LCPs load successfully, with an error message only affecting the licenses from the .lcp
Screenshots
Desktop:
Additional context
LCPs with the frame on any LL with no itens loads correctly.
LCPs with the frame and at least one item on the same LL as the frame also load correctly.
Though the error message wasn't very helpful, looking at the
src/classes/pilot/components/license/License.ts
file through DevTools, at line 44 it defines theconst max
. If there is no item on the frame, it defaultsmax
toframe.LicenseLevel
, but if there is any item it definesmax
as the highest LL required to unlock the item (if multiple itens, the highest LL in the array).Notably, it doesn't count the frame as an item, so if you have a system on LL1 and the frame on LL2 it will look through the array of itens (only 1 system) and get the highest LL to unlock it, in this case 1.
Later on, it defines
Unlocks
based onmax
.And finally, at line 57 it tries to
this.Unlocks[frame.LicenseLevel - 1].unshift(frame)
and throws the error.Workaround
Create a placeholder item on the same LL as the frame.
Haven't tested at a level above, but should work too.
Suggestions
To make this kind of LCP load, I'd suggest setting the
max
based on the higher of the 2 figures, between higher LL required for itens and LL for the frame, rather than only looking at the LL for the frame when there are no itens.To make the rest of the licenses still load, even with a "bad" LCP, I haven't checked the code, but I'd guess the catch exception is stopping the return of the function, so maybe i different way of handling exceptions should fix that. Will try to look at it at a later date and edit the suggestion.
The text was updated successfully, but these errors were encountered: