Skip to content

Commit c9d5125

Browse files
authored
Add Mods Load Verification script
This script checks if mods are loading correctly and reports any issues.
1 parent 1ac8925 commit c9d5125

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Do not delete this script. It helps you know if your mods are loading correctly.
2+
3+
import sys
4+
5+
def initialize_addon():
6+
failed_mods = []
7+
8+
for mod_name, module in list(sys.modules.items()):
9+
if mod_name not in ["soar_main", "soar_autocode", "soar_avss", "Mods Load Verification"] and hasattr(module, "__file__"):
10+
if "soar-mods" in getattr(module, "__file__", ""):
11+
if hasattr(module, "load_error_flag") or getattr(module, "__spec__", None) is None:
12+
failed_mods.append(mod_name)
13+
14+
if failed_mods:
15+
print(f"[!] Mods Load Verification: Detected issues in {len(failed_mods)} mod(s): {', '.join(failed_mods)}")
16+
else:
17+
print("Mods loaded successfully.")

0 commit comments

Comments
 (0)