From d0f8ba06a25ed63bc66f9e0fb02440039d20d0cf Mon Sep 17 00:00:00 2001 From: Myk Taylor Date: Sun, 19 Jul 2020 01:52:57 -0700 Subject: [PATCH] expose new include_prefix param to Lua --- library/LuaApi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index b1dc3de0b..c20be4618 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -2406,8 +2406,11 @@ static int filesystem_listdir_recursive(lua_State *L) int depth = 10; if (lua_type(L, 2) == LUA_TNUMBER) depth = lua_tounsigned(L, 2); + bool include_prefix = true; + if (lua_type(L, 3) == LUA_TBOOLEAN) + include_prefix = lua_toboolean(L, 3); std::map files; - int err = DFHack::Filesystem::listdir_recursive(dir, files, depth); + int err = DFHack::Filesystem::listdir_recursive(dir, files, depth, include_prefix); if (err) { lua_pushnil(L);