Fix error when created multiple items with the same unique ID (!269)

Fixes issue #592
https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/592

Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/269
Co-authored-by: Leaves <mwarciel@gmail.com>
Co-committed-by: Leaves <mwarciel@gmail.com>
This commit is contained in:
Leaves 2024-03-25 08:32:01 +00:00 committed by chomp
parent 757c4506f5
commit 0bb7d1d350
2 changed files with 4 additions and 0 deletions

View File

@ -53,6 +53,7 @@ export class CreateItemResult
constructor()
{
this.success = false;
this.errors = [];
}
success: boolean;

View File

@ -55,6 +55,9 @@ export class CustomItemService
if (tables.templates.items[newItemId])
{
result.errors.push(`ItemId already exists. ${tables.templates.items[newItemId]._name}`);
result.success = false;
result.itemId = newItemId;
return result;
}