0
0
mirror of https://github.com/sp-tarkov/server.git synced 2025-02-12 16:10:43 -05:00

Reordered checks to slightly reduce processing required for check

This commit is contained in:
Chomp 2024-12-06 15:43:20 +00:00
parent 0397c9e121
commit e8c3b69975

View File

@ -139,10 +139,10 @@ export class BotWeaponModLimitService {
// Mod is a mount that can hold only flashlights ad limit is reached (dont want to add empty mounts if limit is reached)
if (
this.itemHelper.isOfBaseclass(modTemplate._id, BaseClasses.MOUNT) &&
modTemplate._props.Slots.some((x) => x._name === "mod_flashlight") &&
modLimits.scope.count >= modLimits.scopeMax &&
modTemplate._props.Slots.length === 1 &&
modLimits.scope.count >= modLimits.scopeMax
this.itemHelper.isOfBaseclass(modTemplate._id, BaseClasses.MOUNT) &&
modTemplate._props.Slots.some((slot) => slot._name === "mod_flashlight")
) {
return true;
}