diff --git a/project/src/helpers/TraderHelper.ts b/project/src/helpers/TraderHelper.ts index c6d7bcf9..f6de9bfa 100644 --- a/project/src/helpers/TraderHelper.ts +++ b/project/src/helpers/TraderHelper.ts @@ -52,7 +52,13 @@ export class TraderHelper { * @param sessionID Players id * @returns Trader base */ - public getTrader(traderID: string, sessionID: string): ITraderBase | undefined { + public getTrader(traderID: string, sessionID: string): ITraderBase | any { + if (traderID === "ragfair") { + return { + currency: "RUB", + }; + } + const pmcData = this.profileHelper.getPmcProfile(sessionID); if (!pmcData) { throw new error(this.localisationService.getText("trader-unable_to_find_profile_with_id", sessionID)); diff --git a/project/src/services/PaymentService.ts b/project/src/services/PaymentService.ts index f42371d7..d7bef550 100644 --- a/project/src/services/PaymentService.ts +++ b/project/src/services/PaymentService.ts @@ -100,7 +100,11 @@ export class PaymentService { this.handbookHelper.inRUB(currencyAmount, currencyTpl), this.paymentHelper.getCurrency(trader.currency), ); - pmcData.TradersInfo[request.tid].salesSum += costOfPurchaseInCurrency; + + // Only update traders + if (this.traderHelper.traderEnumHasKey(request.tid)) { + pmcData.TradersInfo[request.tid].salesSum += costOfPurchaseInCurrency; + } } } @@ -116,7 +120,9 @@ export class PaymentService { pmcData.TradersInfo[request.tid].salesSum += costOfPurchaseInCurrency; } - this.traderHelper.lvlUp(request.tid, pmcData); + if (this.traderHelper.traderEnumHasKey(request.tid)) { + this.traderHelper.lvlUp(request.tid, pmcData); + } this.logger.debug("Item(s) taken. Status OK."); }