aboutsummaryrefslogtreecommitdiff
path: root/src/server.cpp
diff options
context:
space:
mode:
authorMatthew I <matttpt@gmail.com>2012-07-21 21:29:37 -0400
committerPerttu Ahola <celeron55@gmail.com>2012-07-22 13:36:03 +0300
commit136eb323893b8a03bce2cd8b20b09f2f4ade4394 (patch)
tree449940b7c3b04aa87abb0d28e5ba4719c9e40b50 /src/server.cpp
parente3ddbe8c6b70d260f89dfdb0aa7ecb7dab0a12f6 (diff)
downloadminetest-136eb323893b8a03bce2cd8b20b09f2f4ade4394.tar.gz
minetest-136eb323893b8a03bce2cd8b20b09f2f4ade4394.tar.bz2
minetest-136eb323893b8a03bce2cd8b20b09f2f4ade4394.zip
Add minetest.get_modnames() to Lua API
Diffstat (limited to 'src/server.cpp')
-rw-r--r--src/server.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server.cpp b/src/server.cpp
index a44a6a2ee..2a6c6054f 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -4531,6 +4531,13 @@ const ModSpec* Server::getModSpec(const std::string &modname)
}
return NULL;
}
+void Server::getModNames(core::list<std::string> &modlist)
+{
+ for(core::list<ModSpec>::Iterator i = m_mods.begin(); i != m_mods.end(); i++)
+ {
+ modlist.push_back((*i).name);
+ }
+}
std::string Server::getBuiltinLuaPath()
{
return porting::path_share + DIR_DELIM + "builtin";