Style fixes

This commit is contained in:
Refringe 2024-03-30 14:29:08 -04:00
parent 740ab1e563
commit f9d22f409c
No known key found for this signature in database
GPG Key ID: 7715B85B4A6306ED
4 changed files with 12 additions and 9 deletions

View File

@ -597,7 +597,7 @@ export class LocationGenerator
// Build the list of forced loot from both `spawnpointsForced` and any point marked `IsAlwaysSpawn` // Build the list of forced loot from both `spawnpointsForced` and any point marked `IsAlwaysSpawn`
dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced); dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpointsForced);
dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter(point => point.template.IsAlwaysSpawn)); dynamicForcedSpawnPoints.push(...dynamicLootDist.spawnpoints.filter((point) => point.template.IsAlwaysSpawn));
// Add forced loot // Add forced loot
this.addForcedLoot(loot, dynamicForcedSpawnPoints, locationName); this.addForcedLoot(loot, dynamicForcedSpawnPoints, locationName);
@ -647,7 +647,7 @@ export class LocationGenerator
// Add ALL loose loot with 100% chance to pool // Add ALL loose loot with 100% chance to pool
let chosenSpawnpoints: Spawnpoint[] = [...guaranteedLoosePoints]; let chosenSpawnpoints: Spawnpoint[] = [...guaranteedLoosePoints];
const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length const randomSpawnpointCount = desiredSpawnpointCount - chosenSpawnpoints.length;
// only draw random spawn points if needed // only draw random spawn points if needed
if (randomSpawnpointCount > 0 && spawnpointArray.length > 0) if (randomSpawnpointCount > 0 && spawnpointArray.length > 0)
{ {

View File

@ -320,7 +320,7 @@ export class TraderHelper
public addTraderPurchasesToPlayerProfile( public addTraderPurchasesToPlayerProfile(
sessionID: string, sessionID: string,
newPurchaseDetails: { items: { itemId: string; count: number; }[]; traderId: string; }, newPurchaseDetails: { items: { itemId: string; count: number; }[]; traderId: string; },
itemPurchased: Item itemPurchased: Item,
): void ): void
{ {
const profile = this.profileHelper.getFullProfile(sessionID); const profile = this.profileHelper.getFullProfile(sessionID);
@ -351,7 +351,10 @@ export class TraderHelper
continue; continue;
} }
if( profile.traderPurchases[traderId][purchasedItem.itemId].count + purchasedItem.count > itemPurchased.upd.BuyRestrictionMax ) if (
profile.traderPurchases[traderId][purchasedItem.itemId].count + purchasedItem.count
> itemPurchased.upd.BuyRestrictionMax
)
{ {
throw new Error("Unable to purchase item, Purchase limit reached"); throw new Error("Unable to purchase item, Purchase limit reached");
} }

View File

@ -3,14 +3,14 @@ import { TraderServiceType } from "@spt-aki/models/enums/TraderServiceType";
export interface ITraderServiceModel export interface ITraderServiceModel
{ {
serviceType: TraderServiceType; serviceType: TraderServiceType;
itemsToPay?: {[key: string]: number}; itemsToPay?: { [key: string]: number; };
itemsToReceive?: string[]; itemsToReceive?: string[];
subServices?: {[key: string]: number}; subServices?: { [key: string]: number; };
requirements?: ITraderServiceRequirementsModel; requirements?: ITraderServiceRequirementsModel;
} }
export interface ITraderServiceRequirementsModel export interface ITraderServiceRequirementsModel
{ {
completedQuests?: string[]; completedQuests?: string[];
standings?: {[key: string]: number}; standings?: { [key: string]: number; };
} }

View File

@ -57,7 +57,7 @@ export class TraderServicesService
} }
// Clear any unavailable services from the list // Clear any unavailable services from the list
traderServices = traderServices.filter(x => !servicesToDelete.includes(x.serviceType)); traderServices = traderServices.filter((x) => !servicesToDelete.includes(x.serviceType));
return traderServices; return traderServices;
} }