0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-13 09:50:43 -05:00

Log warning when attempting to overwrite existing preset

This commit is contained in:
Chomp 2025-01-03 11:14:01 +00:00
parent ff4e1542f9
commit 47769f1532

View File

@ -527,6 +527,12 @@ export class PostDbLoadService {
protected addCustomItemPresetsToGlobals() { protected addCustomItemPresetsToGlobals() {
for (const presetToAdd of this.itemConfig.customItemGlobalPresets) { for (const presetToAdd of this.itemConfig.customItemGlobalPresets) {
if (this.databaseService.getGlobals().ItemPresets[presetToAdd._id]) {
this.logger.warning(
`Global ItemPreset with Id of: ${presetToAdd._id} already exists, unable to overwrite`,
);
continue;
}
this.databaseService.getGlobals().ItemPresets[presetToAdd._id] = presetToAdd; this.databaseService.getGlobals().ItemPresets[presetToAdd._id] = presetToAdd;
} }
} }