Localised error message

This commit is contained in:
Dev 2024-07-20 13:44:48 +01:00
parent 804e973124
commit 335806bfd8
2 changed files with 5 additions and 2 deletions

View File

@ -141,6 +141,7 @@
"inventory-unable_to_inspect_item_not_in_db": "Unable to inspect item: %s as it cannot be found in the items DB", "inventory-unable_to_inspect_item_not_in_db": "Unable to inspect item: %s as it cannot be found in the items DB",
"inventory-unable_to_remove_item_id_not_found": "Unable to remove item with Id: {{childId}} from profile: {{profileId}} as it could not be found", "inventory-unable_to_remove_item_id_not_found": "Unable to remove item with Id: {{childId}} from profile: {{profileId}} as it could not be found",
"inventory-unable_to_remove_item_no_id_given": "Unable to remove item as no itemId supplied", "inventory-unable_to_remove_item_no_id_given": "Unable to remove item as no itemId supplied",
"inventory-unable_to_remove_item_restart_immediately": "Unable to remove item: {{item}} from mail: {{mailId}} as item could not be found, RESTART GAME CLIENT IMMEDIATELY to prevent data corruption",
"inventory-unable_to_sort_inventory_restart_game": "Unable to find inventory item: %s to auto-sort, YOU MUST RELOAD YOUR GAME IMMEDIATELY TO AVOID CORRUPTING YOUR PROFILE", "inventory-unable_to_sort_inventory_restart_game": "Unable to find inventory item: %s to auto-sort, YOU MUST RELOAD YOUR GAME IMMEDIATELY TO AVOID CORRUPTING YOUR PROFILE",
"inventory-unable_to_toggle_item_not_found": "Unable to toggle inventory item with id: %s, item not found", "inventory-unable_to_toggle_item_not_found": "Unable to toggle inventory item with id: %s, item not found",
"item-durability_value_invalid_use_default": "getRepairableItemQualityValue() weapon tpl: %s durability value is invalid, defaulting to 1", "item-durability_value_invalid_use_default": "getRepairableItemQualityValue() weapon tpl: %s durability value is invalid, defaulting to 1",

View File

@ -551,7 +551,7 @@ export class InventoryHelper
const dialogs = Object.values(fullProfile.dialogues); const dialogs = Object.values(fullProfile.dialogues);
for (const dialog of dialogs) for (const dialog of dialogs)
{ {
const messageWithReward = dialog.messages.find((x) => x._id === removeRequest.fromOwner.id); const messageWithReward = dialog.messages.find((message) => message._id === removeRequest.fromOwner.id);
if (messageWithReward) if (messageWithReward)
{ {
// Find item + any possible children and remove them from mails items array // Find item + any possible children and remove them from mails items array
@ -566,8 +566,10 @@ export class InventoryHelper
if (indexOfItemToRemove === -1) if (indexOfItemToRemove === -1)
{ {
this.logger.error( this.logger.error(
`Unable to remove item: ${removeRequest.item} from mail: ${removeRequest.fromOwner.id} as item could not be found, restart client immediately to prevent data corruption`, this.localisationService.getText("inventory-unable_to_remove_item_restart_immediately",
{ item: removeRequest.item, mailId: removeRequest.fromOwner.id }),
); );
continue; continue;
} }
messageWithReward.items.data.splice(indexOfItemToRemove, 1); messageWithReward.items.data.splice(indexOfItemToRemove, 1);