summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/clua.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/clua.cc b/crawl-ref/source/clua.cc
index bd2b8b85bb..6cd4b70183 100644
--- a/crawl-ref/source/clua.cc
+++ b/crawl-ref/source/clua.cc
@@ -2644,7 +2644,7 @@ static int monster_set(lua_State *ls)
if (!strcmp(attr, "beh")) {
const beh_type beh =
lua_isnumber(ls, 3) ?
- static_cast<beh_type>(lua_tonumber(ls, 3)) :
+ static_cast<beh_type>(luaL_checkint(ls, 3)) :
lua_isstring(ls, 3) ? behaviour_by_name(lua_tostring(ls, 3)) :
NUM_BEHAVIOURS;
if (beh != NUM_BEHAVIOURS)