Skip to content

Commit e8c3b69

Browse files
author
Chomp
committed
Reordered checks to slightly reduce processing required for check
1 parent 0397c9e commit e8c3b69

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

project/src/services/BotWeaponModLimitService.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ export class BotWeaponModLimitService {
139139

140140
// Mod is a mount that can hold only flashlights ad limit is reached (dont want to add empty mounts if limit is reached)
141141
if (
142-
this.itemHelper.isOfBaseclass(modTemplate._id, BaseClasses.MOUNT) &&
143-
modTemplate._props.Slots.some((x) => x._name === "mod_flashlight") &&
142+
modLimits.scope.count >= modLimits.scopeMax &&
144143
modTemplate._props.Slots.length === 1 &&
145-
modLimits.scope.count >= modLimits.scopeMax
144+
this.itemHelper.isOfBaseclass(modTemplate._id, BaseClasses.MOUNT) &&
145+
modTemplate._props.Slots.some((slot) => slot._name === "mod_flashlight")
146146
) {
147147
return true;
148148
}

0 commit comments

Comments
 (0)