diff --git a/src/scripting/lua_unit.cpp b/src/scripting/lua_unit.cpp index ef418caa9b44..29fe4b21b069 100644 --- a/src/scripting/lua_unit.cpp +++ b/src/scripting/lua_unit.cpp @@ -453,9 +453,9 @@ static int impl_unit_set(lua_State *L) map_location dst = src; if(is_key_x) { - dst.set_wml_x(static_cast(luaL_checknumber(L, 3))); + dst.set_wml_x(static_cast(luaL_checkinteger(L, 3))); } else { - dst.set_wml_y(static_cast(luaL_checknumber(L, 3))); + dst.set_wml_y(static_cast(luaL_checkinteger(L, 3))); } // TODO: could probably be relegated to a helper function.