3 * Summary: Travel and exclusions.
21 s
.x
= luaL_checkint(ls
, 1);
22 s
.y
= luaL_checkint(ls
, 2);
23 const coord_def p
= player2grid(s
);
26 int r
= LOS_MAX_RADIUS
;
27 if (lua_gettop(ls
) > 2)
28 r
= luaL_checkint(ls
, 3);
36 s
.x
= luaL_checkint(ls
, 1);
37 s
.y
= luaL_checkint(ls
, 2);
38 const coord_def p
= player2grid(s
);
45 LUAFN(l_feature_is_traversable
)
47 const std::string
&name
= luaL_checkstring(ls
, 1);
48 const dungeon_feature_type feat
= dungeon_feature_by_name(name
);
49 PLUARET(boolean
, feat_is_traversable(feat
));
52 LUAFN(l_find_deepest_explored
)
54 const std::string
&branch
= luaL_checkstring(ls
, 1);
55 const level_id
lid(str_to_branch(branch
), 1);
56 if (lid
.branch
== NUM_BRANCHES
)
57 luaL_error(ls
, "Bad branch name: '%s'", branch
.c_str());
58 PLUARET(number
, find_deepest_explored(lid
).depth
);
61 static const struct luaL_reg travel_lib
[] =
63 { "set_exclude", l_set_exclude
},
64 { "del_exclude", l_del_exclude
},
65 { "feature_traversable", l_feature_is_traversable
},
66 { "find_deepest_explored", l_find_deepest_explored
},
71 void cluaopen_travel(lua_State
*ls
)
73 luaL_openlib(ls
, "travel", travel_lib
, 0);