projects
/
dungeon-master.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
652177d
)
Allow mods structured like modules
author
Javier Sancho
<jsf@jsancho.org>
Wed, 10 Jun 2020 06:46:48 +0000
(08:46 +0200)
committer
Javier Sancho
<jsf@jsancho.org>
Wed, 10 Jun 2020 06:46:48 +0000
(08:46 +0200)
src/mods.cpp
patch
|
blob
|
history
diff --git
a/src/mods.cpp
b/src/mods.cpp
index abdf472bfd8ff25c4c1a6519f1761a11773f94b7..dea09b633b0e40261e5d25c060b849e95bc3339b 100644
(file)
--- 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);
}
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 ();
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";
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)
{
mods_dir = opendir (mods_path.c_str ());
if (mods_dir != NULL)
{