diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 22:43:31 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2022-10-31 22:43:31 +0100 |
commit | 6995e12e188f9a76b680f685a5ff4b6a4c2792e6 (patch) | |
tree | 1439adbccb2878885d9ccb9fc1c56b27e711f948 /editor/editor.cpp | |
parent | bfa3e9a66d28e028fdf69efb79df1b2e47d62bec (diff) |
a
Diffstat (limited to 'editor/editor.cpp')
-rw-r--r-- | editor/editor.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/editor/editor.cpp b/editor/editor.cpp index 04727679..eb0d0f86 100644 --- a/editor/editor.cpp +++ b/editor/editor.cpp @@ -245,14 +245,11 @@ const tile_editor* editor::current() const noexcept { switch (_mode) { - case editor_mode::none: - return nullptr; case editor_mode::floor: return &_floor; case editor_mode::walls: return &_wall; // todo default: - fm_warn_once("invalid editor mode '%u'", (unsigned)_mode); return nullptr; } } @@ -269,10 +266,11 @@ void editor::on_release() auto editor::get_snap_value(snap_mode snap, int mods) const -> snap_mode { - if (snap != snap_mode::none) - return snap; - else if (const auto* mode = current(); mode != nullptr) + + if (const auto* mode = current(); mode != nullptr) return mode->check_snap(mods); + else if (snap != snap_mode::none) + return snap; else return snap_mode::none; } @@ -289,7 +287,6 @@ void editor::on_mouse_move(world& world, global_coords& pos, int mods) switch (snap) { default: - case snap_mode::none: break; case snap_mode::horizontal: pos.y = last_pos.coord.y; |