Skip to content

Commit a4eb9c1

Browse files
AWSWCommunityAWSWCommunity
authored andcommitted
Fix legacy mod detection
1 parent da95280 commit a4eb9c1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

modloader/__init__.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import modinfo
55
import importlib
66
import modinfo
7+
import modclass
78

89
print('AWSW Mod Loader Init')
910

@@ -32,14 +33,15 @@ def get_mod_path():
3233

3334
mod_object = importlib.import_module(mod)
3435

35-
# Run through the module's attributes to determine whether we should load it as a legacy mod.
36-
if not 'loadable_mod' in dir(mod_object):
37-
modinfo.add_mod(mod, mod_object)
36+
# Run through registry to see if the mod implements loadable_mod in some way.
37+
if not any(modinfo.get_mods()[key][4] == mod_object for key in modinfo.get_mods()):
38+
modinfo.add_mod(mod_object.__name__, (None, "", "", "", mod_object))
3839

3940
# After all mods are loaded, call their respective mod_complete functions
40-
for mod_name, mod in modinfo.get_mods().iteritems():
41-
print("Completing mod {}".format(mod_name))
42-
mod.mod_complete()
41+
for mod_name, mod_data in modinfo.get_mods().iteritems():
42+
if mod_data[0]:
43+
print("Completing mod {}".format(mod_name))
44+
mod_data[0].mod_complete()
4345

4446
# force renpy to reindex all game files
4547
renpy.loader.old_config_archives = None

0 commit comments

Comments
 (0)