Cleanup code and also check if standing is 0

This commit is contained in:
Dev 2023-08-02 16:15:33 +01:00
parent 3fefe90b56
commit 172722a915

View File

@ -91,7 +91,7 @@ export class TraderHelper
disabled: false, disabled: false,
loyaltyLevel: rawProfileTemplate.initialLoyaltyLevel, loyaltyLevel: rawProfileTemplate.initialLoyaltyLevel,
salesSum: rawProfileTemplate.initialSalesSum, salesSum: rawProfileTemplate.initialSalesSum,
standing: traderID === "638f541a29ffd1183d187f57" ? 0.01 : rawProfileTemplate.initialStanding, // edge case for Lightkeeper, 0 means seeing `Make Amends - Buyout` quest standing: this.getStartingStanding(traderID, rawProfileTemplate),
nextResupply: this.databaseServer.getTables().traders[traderID].base.nextResupply, nextResupply: this.databaseServer.getTables().traders[traderID].base.nextResupply,
unlocked: this.databaseServer.getTables().traders[traderID].base.unlockedByDefault unlocked: this.databaseServer.getTables().traders[traderID].base.unlockedByDefault
}; };
@ -102,6 +102,17 @@ export class TraderHelper
} }
} }
protected getStartingStanding(traderId: string, rawProfileTemplate: ProfileTraderTemplate): number
{
// Edge case for Lightkeeper, 0 standing means seeing `Make Amends - Buyout` quest
if (traderId === "638f541a29ffd1183d187f57" && rawProfileTemplate.initialStanding === 0)
{
return 0.01;
}
return rawProfileTemplate.initialStanding;
}
/** /**
* Alter a traders unlocked status * Alter a traders unlocked status
* @param traderId Trader to alter * @param traderId Trader to alter