From d7411cd81d0f963bc666e5fdbb7f35733015acc1 Mon Sep 17 00:00:00 2001 From: Andrew Krieger Date: Wed, 11 Dec 2024 10:00:34 -0800 Subject: [PATCH] Fix perspective shift in construction --- src/construction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/construction.cpp b/src/construction.cpp index 42c1f92962c7b..85a194e137b41 100644 --- a/src/construction.cpp +++ b/src/construction.cpp @@ -560,7 +560,8 @@ construction_id construction_menu( const bool blueprint ) tilecontext->set_disable_occlusion( true ); g->invalidate_main_ui_adaptor(); #endif - restore_on_out_of_scope restore_view( player_character.view_offset ); + std::unique_ptr> restore_view = + std::make_unique>( player_character.view_offset ); const auto recalc_buffer = [&]() { //leave room for top and bottom UI text @@ -1061,7 +1062,7 @@ construction_id construction_menu( const bool blueprint ) add_msg( m_info, _( "It is too dark to construct right now." ) ); } else { draw_preview.reset(); - restore_view.cancel(); + restore_view.reset(); restore_ui.reset(); ui.reset(); place_construction( { constructs[select] } );