Add small refactors to 2 functions
This commit is contained in:
parent
d518549711
commit
c2402af09e
@ -1334,6 +1334,7 @@ export class HideoutController {
|
|||||||
|
|
||||||
pmcData.Hideout.Production[request.recipeId] = null;
|
pmcData.Hideout.Production[request.recipeId] = null;
|
||||||
output.profileChanges[sessionId].production = null;
|
output.profileChanges[sessionId].production = null;
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -534,11 +534,13 @@ export class LocationLifecycleService {
|
|||||||
protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void {
|
protected handleBTRItemTransferEvent(sessionId: string, request: IEndLocalRaidRequestData): void {
|
||||||
const btrKey = "BTRTransferStash";
|
const btrKey = "BTRTransferStash";
|
||||||
const btrContainerAndItems = request.transferItems[btrKey] ?? [];
|
const btrContainerAndItems = request.transferItems[btrKey] ?? [];
|
||||||
if (btrContainerAndItems.length > 0) {
|
if (btrContainerAndItems.length === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const itemsToSend = btrContainerAndItems.filter((item) => item._id !== btrKey);
|
const itemsToSend = btrContainerAndItems.filter((item) => item._id !== btrKey);
|
||||||
this.btrItemDelivery(sessionId, Traders.BTR, itemsToSend);
|
this.btrItemDelivery(sessionId, Traders.BTR, itemsToSend);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void {
|
protected btrItemDelivery(sessionId: string, traderId: string, items: Item[]): void {
|
||||||
const serverProfile = this.saveServer.getProfile(sessionId);
|
const serverProfile = this.saveServer.getProfile(sessionId);
|
||||||
|
@ -47,6 +47,8 @@ export class OpenZoneService {
|
|||||||
for (const mapKey in this.locationConfig.openZones) {
|
for (const mapKey in this.locationConfig.openZones) {
|
||||||
if (!dbLocations[mapKey]) {
|
if (!dbLocations[mapKey]) {
|
||||||
this.logger.error(this.localisationService.getText("openzone-unable_to_find_map", mapKey));
|
this.logger.error(this.localisationService.getText("openzone-unable_to_find_map", mapKey));
|
||||||
|
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const dbLocationToUpdate: ILocationBase = dbLocations[mapKey].base;
|
const dbLocationToUpdate: ILocationBase = dbLocations[mapKey].base;
|
||||||
|
Loading…
Reference in New Issue
Block a user