From c66f8a865056e7e2e8a9461d23691665b82dd59a Mon Sep 17 00:00:00 2001 From: dshaligram Date: Mon, 25 Jun 2007 16:35:03 +0000 Subject: Croak if necessary Lua files are missing, instead of failing subtly later. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1651 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/clua.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/clua.h') diff --git a/crawl-ref/source/clua.h b/crawl-ref/source/clua.h index 6759687494..2fd6bf835e 100644 --- a/crawl-ref/source/clua.h +++ b/crawl-ref/source/clua.h @@ -65,7 +65,8 @@ public: int loadstring(const char *str, const char *context); int execstring(const char *str, const char *context = "init.txt"); - int execfile(const char *filename, bool trusted = false); + int execfile(const char *filename, bool trusted = false, + bool die_on_fail = false); bool callbooleanfn(bool defval, const char *fn, const char *params, ...); bool callfn(const char *fn, int nargs, int nret = 1); @@ -74,7 +75,8 @@ public: bool runhook(const char *hook, const char *params, ...); static int file_write(lua_State *ls); - static int loadfile(lua_State *ls, const char *file, bool trusted = false); + static int loadfile(lua_State *ls, const char *file, + bool trusted = false, bool die_on_fail = false); static bool is_path_safe(std::string file, bool trusted = false); public: -- cgit v1.2.3-54-g00ecf