Change `foreach` to use `for of` instead, `for of` is faster than `foreach`
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/248
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Addresses: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/443
Re-added the ability to keep pocket items on death. The reason for the naming is to not confuse the root `Pockets` item. Where as `PocketItems` is a better descriptive fit for the behaviour.
New property in lostondeath.json -> `equipment.PocketItems` default `true` to discard items in pockets as normal on death.
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/246
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
When the server was being built on systems other than Windows, that system's version of node was being downloaded for the build instead of the expected versions (Win/x64). This change hardcodes the values so that they're no longer dynamically pulled from the current system. Should help with generating automated builds.
Also, re-enabled the build step that added the icon to the Windows executable. It was being skipped over on non-Windows platforms and I don't know why... it should be a cross-platform solution.
In relation to this QoL issue: https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/547
This PR allows us to prevent fence selling duplicate items by parentId.
It adds a new property to `trader.json` `fence.preventDuplicateOffersOfCategory` its an array that takes parentIds. The scope of this PR only extends to ammo and ammo boxes. It can be expanded upon in the future with no code changes should the need arise.
The reason for this change is because currently fence can have duplicate stacks of identical ammo with different prices, which makes no sense. If you have any questions feel free to ping me on discord.
Co-authored-by: Cj <161484149+CJ-SPT@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/245
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Capturing outposts has a condition change, can now be done in zone "prapor_27_3" only, not 4
Missing informant had its available for finish conditions altered + has a new visibility condition
Added % chance to have loot to config
Added currency added weigfht system to config (only roubles by default)
Added allowed wallet types array to config
Added WZ wallet to pool of wallets to add money to
Fixed bug where itemCount type was incorrect
Allows modders to blacklist entire categories from ragfair in relation to https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/525
new properties under `RagfairConfig.dynamic.blacklist`
`enableCustomItemCategoryList` - this enables the custom custom category blacklist
`customItemCategoryList` - this is an array to take a list of parent id's
I tested it to confirm its working, will need some further testing.
Co-authored-by: Corey <dirtbikercj@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/244
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Corrects previous pull request hardcoding the value for `ratingSumForIncrease`.
Anytime it changes in globals it will now be reflected without needing to change it in `RagFairOfferHelper`
Co-authored-by: Corey <dirtbikercj@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/243
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Should address massive flea rep gains. Tested about 10 cases, all seem within expected range.
Divided ratingIncreaseCount by a factor of 100000
Co-authored-by: Corey <dirtbikercj@gmail.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/242
Co-authored-by: Cj <cj@noreply.dev.sp-tarkov.com>
Co-committed-by: Cj <cj@noreply.dev.sp-tarkov.com>
Refactored `registerProduction()` to also use this code
Fix code that was getting value to 4dp, not 3dp
Skip doing work in `getHideoutManagementConsumptionBonus()` if hideoutMgmt skill is 0
The error people are getting about a lock file already existing is due to `checkFileSync` returning false if the lock file is "stale".
The default "stale" timeout is 10 seconds, so if a save takes longer than this, the user will end up in a state where they can no longer save.
The documentation for `proper-lockfile` recommends using the callback returned by `lockFileSync` to remove the lock file, so I've switched to using this, and the error no longer occurs with long running save operations
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/239
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
This resolves an issue where FiR tools were coming back as non-FiR. We now just store the whole .upd property, so any stats on the tool should carry over to after the craft is finished
Note: Will break any in-progress crafts that use tools
Co-authored-by: DrakiaXYZ <565558+TheDgtl@users.noreply.github.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/238
Co-authored-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
Co-committed-by: DrakiaXYZ <drakiaxyz@noreply.dev.sp-tarkov.com>
#### Summary
> Should fix [Issue 523](https://dev.sp-tarkov.com/SPT-AKI/Issues/issues/523)
Tested a few different scenarios and the items were always correctly removed and returned to the player, however I did see the console warnings reported in the issue.
Both of the following call `this.ragfairOfferHandler.removeOffer(...)`:
- `this.returnPlayerOffer(...)`
- `this.removeOfferById(...)`
The latter logs a warning to the console because the offer is already removed when we reach that point.
This fix simply returns after the offer has been returned to the player, letting `returnPlayerOffer` deal with removing from the flea
Co-authored-by: phrisk <phrisk@phrisk.com>
Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/237
Co-authored-by: phrisk <phrisk@noreply.dev.sp-tarkov.com>
Co-committed-by: phrisk <phrisk@noreply.dev.sp-tarkov.com>