diff --git a/project/src/routers/EventOutputHolder.ts b/project/src/routers/EventOutputHolder.ts index c43c9780..b366a62b 100644 --- a/project/src/routers/EventOutputHolder.ts +++ b/project/src/routers/EventOutputHolder.ts @@ -1,6 +1,11 @@ import { ProfileHelper } from "@spt/helpers/ProfileHelper"; import { IPmcData } from "@spt/models/eft/common/IPmcData"; -import { IHideoutImprovement, Productive, TraderInfo } from "@spt/models/eft/common/tables/IBotBase"; +import { + IHideoutImprovement, + IMoneyTransferLimits, + Productive, + TraderInfo, +} from "@spt/models/eft/common/tables/IBotBase"; import { ProfileChange, TraderData } from "@spt/models/eft/itemEvent/IItemEventRouterBase"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { TimeUtil } from "@spt/utils/TimeUtil"; @@ -79,12 +84,20 @@ export class EventOutputHolder { profileChanges.improvements = this.cloner.clone(this.getImprovementsFromProfileAndFlagComplete(pmcData)); profileChanges.traderRelations = this.constructTraderRelations(pmcData.TradersInfo); + this.resetMoneyTransferLimit(pmcData.moneyTransferLimitData); profileChanges.moneyTransferLimitData = pmcData.moneyTransferLimitData; // Fixes container craft from water collector not resetting after collection + removed completed normal crafts this.cleanUpCompleteCraftsInProfile(pmcData.Hideout.Production); } + protected resetMoneyTransferLimit(limit: IMoneyTransferLimits) { + if (limit.nextResetTime < this.timeUtil.getTimestamp()) { + limit.nextResetTime = this.timeUtil.getTimeStampFromNowDays(1); + limit.remainingLimit = limit.totalLimit; + } + } + /** * Convert the internal trader data object into an object we can send to the client * @param traderData server data for traders