Skip to content

Commit 30982f5

Browse files
InfernioUtumno
authored andcommitted
Fix ESL activation with 254 mods RRR
Was trying to activate the ESL's masters, even when they were already enabled. This normally fails two lines down, at the 'fileName not in self._active_wip' check, but not if you have 254 masters, where it causes a 'too many masters' warning first. We now check if the masters haven't already been enabled before trying to activate them. May make mod activation a bit faster as well - also went ahead and sped up the active_wip lookup by making a set for it, since lookup occurs for each master and can potentially take O(m*n) time, where m = #masters and n = #LO mods. Now takes at most O(m) time. This could potentially have affected load orders for the older games as well, but I haven't tested it yet. Under # 309 <--- RRR
1 parent 1585f5d commit 30982f5

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Mopy/bash/bosh/__init__.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2313,11 +2313,15 @@ def lo_activate(self, fileName, doSave=True, _modSet=None, _children=None,
23132313
# Disabled for now
23142314
##if self[fileName].hasBadMasterNames():
23152315
## return
2316+
# Speed up lookups, since they occur for the plugin and all masters
2317+
acti_set = set(self._active_wip)
23162318
for master in self[fileName].get_masters():
2317-
if master in _modSet: self.lo_activate(master, False, _modSet,
2318-
_children, _activated)
2319+
# Check that the master is on disk and not already activated
2320+
if master in _modSet and master not in acti_set:
2321+
self.lo_activate(master, False, _modSet, _children,
2322+
_activated)
23192323
#--Select in plugins
2320-
if fileName not in self._active_wip:
2324+
if fileName not in acti_set:
23212325
self._active_wip.append(fileName)
23222326
_activated.add(fileName)
23232327
return load_order.get_ordered(_activated or [])

0 commit comments

Comments
 (0)