WARNING: This is a very low-level call. Usage: goto_place("placename", ) "placename" is the name of the place as used in maps, such as "Lair:2", "Vaults:$", etc. If is specified, the entrance point of the branch specified in place_name is bound to the given level in the parent branch (the entrance level should be 1-based). This can be helpful when testing scenarios
| 44 | // when testing scenarios that depend on the absolute depth of the current |
| 45 | // place. |
| 46 | LUAFN(debug_goto_place) |
| 47 | { |
| 48 | try |
| 49 | { |
| 50 | const level_id id = level_id::parse_level_id(luaL_checkstring(ls, 1)); |
| 51 | const int bind_entrance = |
| 52 | lua_isnumber(ls, 2)? luaL_safe_checkint(ls, 2) : -1; |
| 53 | |
| 54 | if (is_connected_branch(id.branch)) |
| 55 | you.level_stack.clear(); |
| 56 | else |
| 57 | { |
| 58 | for (int i = you.level_stack.size() - 1; i >= 0; i--) |
| 59 | if (you.level_stack[i].id == id) |
| 60 | you.level_stack.resize(i); |
| 61 | if (!player_in_branch(id.branch)) |
| 62 | you.level_stack.push_back(level_pos::current()); |
| 63 | } |
| 64 | |
| 65 | you.goto_place(id); |
| 66 | if (bind_entrance != -1) |
| 67 | brentry[you.where_are_you].depth = bind_entrance; |
| 68 | } |
| 69 | catch (const bad_level_id &err) |
| 70 | { |
| 71 | luaL_error(ls, err.what()); |
| 72 | } |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | LUAWRAP(debug_dungeon_setup, initial_dungeon_setup()) |
| 77 |
nothing calls this directly
no test coverage detected