From feed3accdc0482b11535c72119ea73f627f633ed Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Wed, 10 Jun 2020 08:46:48 +0200 Subject: [PATCH] Allow mods structured like modules --- src/mods.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mods.cpp b/src/mods.cpp index abdf472..dea09b6 100644 --- a/src/mods.cpp +++ b/src/mods.cpp @@ -43,6 +43,13 @@ void scm_init_dungeon_master_module () scm_c_define_module ("dungeon-master", init_dungeon_master_module, NULL); } +void add_to_load_path (std::string path) +{ + // Add path to %load-path variable, needed for modules created in mods + std::string exp = "(add-to-load-path \"" + path + "\")"; + scm_c_eval_string (exp.c_str ()); +} + void load_dmaster_mods () { scm_init_guile (); @@ -58,6 +65,7 @@ void load_dmaster_mods () for (const std::string &path : paths) { mods_path = path + PATH_DELIM + "mods"; + add_to_load_path (mods_path); mods_dir = opendir (mods_path.c_str ()); if (mods_dir != NULL) { -- 2.39.5