diff --git a/project/src/controllers/HideoutController.ts b/project/src/controllers/HideoutController.ts index 40650247..9be4c369 100644 --- a/project/src/controllers/HideoutController.ts +++ b/project/src/controllers/HideoutController.ts @@ -329,7 +329,7 @@ export class HideoutController } /** - * @param output Objet to send to client + * @param output Object to send to client * @param sessionID Session/player id * @param areaType Hideout area that had stash added * @param hideoutDbData Hideout area that caused addition of stash @@ -1137,13 +1137,14 @@ export class HideoutController // Add all improvemets to output object const improvements = hideoutDbData.stages[profileHideoutArea.level].improvements; const timestamp = this.timeUtil.getTimestamp(); + + if (!output.profileChanges[sessionId].improvements) + { + output.profileChanges[sessionId].improvements = {}; + } + for (const improvement of improvements) { - if (!output.profileChanges[sessionId].improvements) - { - output.profileChanges[sessionId].improvements = {}; - } - const improvementDetails = { completed: false, improveCompleteTimestamp: timestamp + improvement.improvementTime, diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index d9f6ae3f..c6b0318a 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -419,7 +419,12 @@ export class QuestController activeQuests: [repeatableQuestProfile], inactiveQuests: [], }; - acceptQuestResponse.profileChanges[sessionID].repeatableQuests = [responseData]; + + if (!acceptQuestResponse.profileChanges[sessionID].repeatableQuests) + { + acceptQuestResponse.profileChanges[sessionID].repeatableQuests = [] + } + acceptQuestResponse.profileChanges[sessionID].repeatableQuests.push(responseData); return acceptQuestResponse; } @@ -498,7 +503,7 @@ export class QuestController this.addTimeLockedQuestsToProfile(pmcData, [...questDelta, ...questsToFail], body.qid); // Inform client of quest changes - completeQuestResponse.profileChanges[sessionID].quests = questDelta; + completeQuestResponse.profileChanges[sessionID].quests.push(...questDelta); // Check if it's a repeatable quest. If so, remove from Quests and repeatable.activeQuests list + move to repeatable.inactiveQuests for (const currentRepeatable of pmcData.RepeatableQuests) diff --git a/project/src/controllers/RepeatableQuestController.ts b/project/src/controllers/RepeatableQuestController.ts index aae1d79c..fa96dbce 100644 --- a/project/src/controllers/RepeatableQuestController.ts +++ b/project/src/controllers/RepeatableQuestController.ts @@ -457,7 +457,11 @@ export class RepeatableQuestController droppedQuestTrader.standing -= changeRequirement.changeStandingCost; // Update client output with new repeatable - output.profileChanges[sessionID].repeatableQuests = [repeatableToChange]; + if (!output.profileChanges[sessionID].repeatableQuests) + { + output.profileChanges[sessionID].repeatableQuests = []; + } + output.profileChanges[sessionID].repeatableQuests.push(repeatableToChange); return output; }