mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-12 16:10:43 -05:00
Moved deprioritisedContainers
data into config as deprioritisedMoneyContainers
This commit is contained in:
parent
572144c662
commit
863738087f
@ -1595,5 +1595,6 @@
|
|||||||
"customMoneyTpls": [],
|
"customMoneyTpls": [],
|
||||||
"skillGainMultiplers": {
|
"skillGainMultiplers": {
|
||||||
"Strength": 1
|
"Strength": 1
|
||||||
}
|
},
|
||||||
|
"deprioritisedMoneyContainers": ["590c60fc86f77412b13fddcf", "5d235bb686f77443f4331278"]
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,8 @@ export interface IInventoryConfig extends IBaseConfig {
|
|||||||
customMoneyTpls: string[];
|
customMoneyTpls: string[];
|
||||||
/** Multipliers for skill gain when inside menus, NOT in-game */
|
/** Multipliers for skill gain when inside menus, NOT in-game */
|
||||||
skillGainMultiplers: Record<string, number>;
|
skillGainMultiplers: Record<string, number>;
|
||||||
|
/** Container Tpls that shoud be deprioritised when choosing where to take money from for payments */
|
||||||
|
deprioritisedMoneyContainers: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IRewardDetails {
|
export interface IRewardDetails {
|
||||||
|
@ -10,7 +10,10 @@ import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRo
|
|||||||
import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData";
|
import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData";
|
||||||
import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData";
|
import { IProcessSellTradeRequestData } from "@spt/models/eft/trade/IProcessSellTradeRequestData";
|
||||||
import { BackendErrorCodes } from "@spt/models/enums/BackendErrorCodes";
|
import { BackendErrorCodes } from "@spt/models/enums/BackendErrorCodes";
|
||||||
|
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
|
||||||
|
import { IInventoryConfig } from "@spt/models/spt/config/IInventoryConfig";
|
||||||
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
import { ILogger } from "@spt/models/spt/utils/ILogger";
|
||||||
|
import { ConfigServer } from "@spt/servers/ConfigServer";
|
||||||
import { DatabaseService } from "@spt/services/DatabaseService";
|
import { DatabaseService } from "@spt/services/DatabaseService";
|
||||||
import { LocalisationService } from "@spt/services/LocalisationService";
|
import { LocalisationService } from "@spt/services/LocalisationService";
|
||||||
import { HashUtil } from "@spt/utils/HashUtil";
|
import { HashUtil } from "@spt/utils/HashUtil";
|
||||||
@ -19,6 +22,8 @@ import { inject, injectable } from "tsyringe";
|
|||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class PaymentService {
|
export class PaymentService {
|
||||||
|
protected inventoryConfig: IInventoryConfig;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject("PrimaryLogger") protected logger: ILogger,
|
@inject("PrimaryLogger") protected logger: ILogger,
|
||||||
@inject("HashUtil") protected hashUtil: HashUtil,
|
@inject("HashUtil") protected hashUtil: HashUtil,
|
||||||
@ -30,7 +35,10 @@ export class PaymentService {
|
|||||||
@inject("InventoryHelper") protected inventoryHelper: InventoryHelper,
|
@inject("InventoryHelper") protected inventoryHelper: InventoryHelper,
|
||||||
@inject("LocalisationService") protected localisationService: LocalisationService,
|
@inject("LocalisationService") protected localisationService: LocalisationService,
|
||||||
@inject("PaymentHelper") protected paymentHelper: PaymentHelper,
|
@inject("PaymentHelper") protected paymentHelper: PaymentHelper,
|
||||||
) {}
|
@inject("ConfigServer") protected configServer: ConfigServer,
|
||||||
|
) {
|
||||||
|
this.inventoryConfig = this.configServer.getConfig(ConfigTypes.INVENTORY);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Take money and insert items into return to server request
|
* Take money and insert items into return to server request
|
||||||
@ -369,7 +377,7 @@ export class PaymentService {
|
|||||||
// Both in stash in containers
|
// Both in stash in containers
|
||||||
if (aInStash && bInStash) {
|
if (aInStash && bInStash) {
|
||||||
// Containers where taking money from would inconvinence player
|
// Containers where taking money from would inconvinence player
|
||||||
const deprioritisedContainers = ["590c60fc86f77412b13fddcf", "5d235bb686f77443f4331278"];
|
const deprioritisedContainers = this.inventoryConfig.deprioritisedMoneyContainers;
|
||||||
const aImmediateParent = inventoryItems.find((item) => item._id === a.parentId);
|
const aImmediateParent = inventoryItems.find((item) => item._id === a.parentId);
|
||||||
const bImmediateParent = inventoryItems.find((item) => item._id === b.parentId);
|
const bImmediateParent = inventoryItems.find((item) => item._id === b.parentId);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user