Fixed itemDelivery() failing when trader lacks a dialogue object (incorrectly configured custom traders)

This commit is contained in:
Dev 2024-04-15 09:06:11 +01:00
parent 8cbc51d20e
commit 9c81df91d1

View File

@ -661,6 +661,12 @@ export class InraidController
const pmcData = serverProfile.characters.pmc;
const dialogueTemplates = this.databaseServer.getTables().traders[traderId].dialogue;
if (!dialogueTemplates)
{
this.logger.error(`Unable to deliver items as trader ${traderId} has no "dialogue" data`);
return;
}
const messageId = this.randomUtil.getArrayValue(dialogueTemplates.itemsDelivered);
const messageStoreTime = this.timeUtil.getHoursAsSeconds(this.traderConfig.fence.btrDeliveryExpireHours);