Skip to content

Commit 3a48f5e

Browse files
committed
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 4b9f808 commit 3a48f5e

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
@@ -2312,11 +2312,15 @@ def lo_activate(self, fileName, doSave=True, _modSet=None, _children=None,
23122312
# Disabled for now
23132313
##if self[fileName].hasBadMasterNames():
23142314
## return
2315+
# Speed up lookups, since they occur for the plugin and all masters
2316+
acti_set = set(self._active_wip)
23152317
for master in self[fileName].get_masters():
2316-
if master in _modSet: self.lo_activate(master, False, _modSet,
2317-
_children, _activated)
2318+
# Check that the master is on disk and not already activated
2319+
if master in _modSet and master not in acti_set:
2320+
self.lo_activate(master, False, _modSet, _children,
2321+
_activated)
23182322
#--Select in plugins
2319-
if fileName not in self._active_wip:
2323+
if fileName not in acti_set:
23202324
self._active_wip.append(fileName)
23212325
_activated.add(fileName)
23222326
return load_order.get_ordered(_activated or [])

0 commit comments

Comments
 (0)