Skip to content

Commit

Permalink
Reordered checks to slightly reduce processing required for check
Browse files Browse the repository at this point in the history
  • Loading branch information
Chomp committed Dec 6, 2024
1 parent 0397c9e commit e8c3b69
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions project/src/services/BotWeaponModLimitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e8c3b69

Please sign in to comment.