summaryrefslogtreecommitdiff
path: root/library/LuaWrapper.cpp
diff options
context:
space:
mode:
authorAlexander Gavrilov2012-03-24 16:28:53 +0400
committerAlexander Gavrilov2012-03-24 16:28:53 +0400
commit0c7fc233bd848885fb05656ea15f68eb2a9cada7 (patch)
treefa275eafd1104c6b85542e3e707bf61349945c92 /library/LuaWrapper.cpp
parentd865d54a90dcff0d30b8c7c3a95f8d8c2f24de62 (diff)
downloaddfhack-0c7fc233bd848885fb05656ea15f68eb2a9cada7.tar.gz
dfhack-0c7fc233bd848885fb05656ea15f68eb2a9cada7.tar.bz2
dfhack-0c7fc233bd848885fb05656ea15f68eb2a9cada7.tar.xz
Support resize/erase/insert for containers, and allow any index in BitArray.
Diffstat (limited to 'library/LuaWrapper.cpp')
-rw-r--r--library/LuaWrapper.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/library/LuaWrapper.cpp b/library/LuaWrapper.cpp
index 1e4574fd..7a871e4b 100644
--- a/library/LuaWrapper.cpp
+++ b/library/LuaWrapper.cpp
@@ -593,7 +593,10 @@ static int meta_new(lua_State *state)
void *ptr = id->allocate();
if (!ptr)
- return 0;
+ {
+ lua_pushnil(state);
+ return 1;
+ }
if (lua_isuserdata(state, 1))
{