mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
FIx null excpetion when a weapon reward is picked that has no presets
We only want the default preset, so use that function instead
This commit is contained in:
parent
c1a4c544bc
commit
b3f5ea8287
@ -1077,8 +1077,7 @@ export class RepeatableQuestController
|
|||||||
}
|
}
|
||||||
else if (this.itemHelper.isOfBaseclass(itemSelected[0], BaseClasses.WEAPON))
|
else if (this.itemHelper.isOfBaseclass(itemSelected[0], BaseClasses.WEAPON))
|
||||||
{
|
{
|
||||||
const presets = this.presetHelper.getPresets(itemSelected[0]);
|
const defaultPreset = this.presetHelper.getDefaultPreset(itemSelected[0]);
|
||||||
const defaultPreset = presets.find(x => x._encyclopedia);
|
|
||||||
if (defaultPreset)
|
if (defaultPreset)
|
||||||
{
|
{
|
||||||
children = this.ragfairServerHelper.reparentPresets(defaultPreset._items[0], defaultPreset._items);
|
children = this.ragfairServerHelper.reparentPresets(defaultPreset._items[0], defaultPreset._items);
|
||||||
|
@ -69,6 +69,11 @@ export class PresetHelper
|
|||||||
return presets;
|
return presets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default preset for passed in weapon id
|
||||||
|
* @param templateId Weapon id to get preset for
|
||||||
|
* @returns Null if no default preset, otherwise IPreset
|
||||||
|
*/
|
||||||
public getDefaultPreset(templateId: string): IPreset
|
public getDefaultPreset(templateId: string): IPreset
|
||||||
{
|
{
|
||||||
if (!this.hasPreset(templateId))
|
if (!this.hasPreset(templateId))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user