| 759 | } |
| 760 | |
| 761 | void process_command(command_type cmd) |
| 762 | { |
| 763 | auto ret = process_map_command(cmd, m_state); |
| 764 | // reentry happens if during the process, something else called in to |
| 765 | // set_lpos. E.g. this can happen via a describe popup. If this |
| 766 | // happened, then it set m_state and we don't want to overwrite it. |
| 767 | // TODO some refactoring to make this cleaner |
| 768 | if (!check_and_reset_reentry()) |
| 769 | m_state = std::move(ret); |
| 770 | |
| 771 | if (!m_state.map_alive) |
| 772 | return; |
| 773 | |
| 774 | if (m_state.lpos.id != level_id::current()) |
| 775 | goto_level(); |
| 776 | |
| 777 | m_state.lpos.pos = m_state.lpos.pos.clamped(known_map_bounds()); |
| 778 | } |
| 779 | |
| 780 | void set_lpos(level_pos dest) |
| 781 | { |
no test coverage detected