summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/l_dgn_bf.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/l_dgn_bf.cc b/crawl-ref/source/l_dgn_bf.cc
index 8c4d471fc9..e79e6799e6 100644
--- a/crawl-ref/source/l_dgn_bf.cc
+++ b/crawl-ref/source/l_dgn_bf.cc
@@ -20,7 +20,7 @@ static int _table_int(lua_State *ls, int idx, const char *name, int defval)
bool valid = lua_isnumber(ls, idx);
if (!nil && !valid)
luaL_error(ls, "'%s' in table, but not an int.", name);
- int ret = (!nil && valid ? lua_tonumber(ls, idx) : defval);
+ int ret = (!nil && valid ? luaL_checkint(ls, idx) : defval);
lua_pop(ls, 1);
return (ret);
}