diff options
author | Adam Borowski <kilobyte@angband.pl> | 2010-09-04 02:44:17 +0200 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2010-09-04 02:44:17 +0200 |
commit | a2f257aecb00e73e7aec602d8fd7795d5993019c (patch) | |
tree | 1f22c48ce222a96cea1c26ada550698acaa8e568 /crawl-ref/source/clua.cc | |
parent | 1f40d3bf8b813bd7bd66f4bf9e28a4166a3bc0b2 (diff) | |
download | crawl-ref-a2f257aecb00e73e7aec602d8fd7795d5993019c.tar.gz crawl-ref-a2f257aecb00e73e7aec602d8fd7795d5993019c.zip |
Store the "lua" subfile as a chunk.
Diffstat (limited to 'crawl-ref/source/clua.cc')
-rw-r--r-- | crawl-ref/source/clua.cc | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc index 686017f555..2570ba9b30 100644 --- a/crawl-ref/source/clua.cc +++ b/crawl-ref/source/clua.cc @@ -116,15 +116,14 @@ void CLua::gc() lua_gc(state(), LUA_GCCOLLECT, 0); } -void CLua::save(const char *file) +void CLua::save(writer &outf) { if (!_state) return; - CLuaSave clsave = { file, NULL }; - callfn("c_save", "u", &clsave); - if (clsave.handle) - fclose(clsave.handle); + std::string res; + callfn("c_save", ">s", &res); + outf.write(res.c_str(), res.size()); } int CLua::file_write(lua_State *ls) |