diff --git a/project/src/helpers/RagfairServerHelper.ts b/project/src/helpers/RagfairServerHelper.ts index 47e98898..2ac0464c 100644 --- a/project/src/helpers/RagfairServerHelper.ts +++ b/project/src/helpers/RagfairServerHelper.ts @@ -160,7 +160,7 @@ export class RagfairServerHelper MessageType.MESSAGE_WITH_ITEMS, RagfairServerHelper.goodsReturnedTemplate, returnedItems, - this.timeUtil.getHoursAsSeconds(this.questConfig.redeemTime), + this.timeUtil.getHoursAsSeconds(this.databaseServer.getTables().globals.config.RagFair.yourOfferDidNotSellMaxStorageTimeInHour), ); } diff --git a/project/src/services/RagfairOfferService.ts b/project/src/services/RagfairOfferService.ts index 1dfea886..d49ad240 100644 --- a/project/src/services/RagfairOfferService.ts +++ b/project/src/services/RagfairOfferService.ts @@ -240,15 +240,18 @@ export class RagfairOfferService ); } - profile.RagfairInfo.rating -= this.ragfairConfig.sell.reputation.loss; + // Reduce player ragfair rep + profile.RagfairInfo.rating -= this.databaseServer.getTables().globals.config.RagFair.ratingDecreaseCount; profile.RagfairInfo.isRatingGrowing = false; - if (offer.items[0].upd.StackObjectsCount > offer.items[0].upd.OriginalStackObjectsCount) + const firstOfferItem = offer.items[0]; + if (firstOfferItem.upd.StackObjectsCount > firstOfferItem.upd.OriginalStackObjectsCount) { - offer.items[0].upd.StackObjectsCount = offer.items[0].upd.OriginalStackObjectsCount; + offer.items[0].upd.StackObjectsCount = firstOfferItem.upd.OriginalStackObjectsCount; } delete offer.items[0].upd.OriginalStackObjectsCount; + // Send failed offer items to player in mail this.ragfairServerHelper.returnItems(profile.sessionId, offer.items); profile.RagfairInfo.offers.splice(offerIndex, 1);