Added ability to send insurance mail after Labs raid via editing of labs `base.json/insurance property

This commit is contained in:
Dev 2024-04-16 17:28:00 +01:00
parent f50a400cde
commit 0bc807a6b8

View File

@ -549,10 +549,16 @@ export class InsuranceController
*/ */
protected sendMail(sessionID: string, insurance: Insurance): void protected sendMail(sessionID: string, insurance: Insurance): void
{ {
const labsId = "laboratory";
// After all of the item filtering that we've done, if there are no items remaining, the insurance has // After all of the item filtering that we've done, if there are no items remaining, the insurance has
// successfully "failed" to return anything and an appropriate message should be sent to the player. // successfully "failed" to return anything and an appropriate message should be sent to the player.
const traderDialogMessages = this.databaseServer.getTables().traders[insurance.traderId].dialogue; const traderDialogMessages = this.databaseServer.getTables().traders[insurance.traderId].dialogue;
if (insurance.systemData?.location.toLowerCase() === "laboratory")
// Map is labs + insurance is disabled in base.json
if (
insurance.systemData?.location.toLowerCase() === labsId
&& !this.databaseServer.getTables().locations[labsId].base.Insurance
)
{ {
// Trader has labs-specific messages // Trader has labs-specific messages
// Wipe out returnable items // Wipe out returnable items