diff --git a/src/condition.cpp b/src/condition.cpp index d19199c15c764..bc877ee7e536e 100644 --- a/src/condition.cpp +++ b/src/condition.cpp @@ -1789,7 +1789,7 @@ std::function conditional_t::get_get_int( const JsonObject } return false; } ); - return targets.size(); + return static_cast( targets.size() ); }; } } else if( jo.has_member( "moon" ) ) { diff --git a/src/npctrade.h b/src/npctrade.h index 6eb4b5df7c2e8..b54fd4f2acd60 100644 --- a/src/npctrade.h +++ b/src/npctrade.h @@ -20,17 +20,17 @@ struct faction_price_rule; class item_pricing { public: - item_pricing( Character &c, item &it, int v, int count ) : loc( c, &it ), price( v ) { + item_pricing( Character &c, item &it, double v, int count ) : loc( c, &it ), price( v ) { set_values( count ); } - item_pricing( item_location &&l, int v, int count ) : loc( std::move( l ) ), price( v ) { + item_pricing( item_location &&l, double v, int count ) : loc( std::move( l ) ), price( v ) { set_values( count ); } void set_values( int ip_count ); item_location loc; - int price = 0; + double price = 0; // Whether this is selected for trading bool selected = false; bool is_container = false; diff --git a/src/worldfactory.cpp b/src/worldfactory.cpp index a037511dd41d8..f5ada5f37c62f 100644 --- a/src/worldfactory.cpp +++ b/src/worldfactory.cpp @@ -563,7 +563,7 @@ WORLD *worldfactory::pick_world( bool show_prompt, bool empty_only ) const bool sel_this = static_cast( i ) == sel; inclusive_rectangle btn( world_list_top_left + point( 4, i ), world_list_top_left + point( world_list_width - 1, i ) ); - button_map.emplace( i, btn ); + button_map.emplace( static_cast( i ), btn ); mvwprintz( w_worlds, point( 0, static_cast( i ) ), c_white, "%d", i + 1 ); wmove( w_worlds, point( 4, static_cast( i ) ) ); @@ -868,7 +868,7 @@ std::map> worldfactory::draw_mod_list( const cat } mod_entry_name += string_format( _( " [%s]" ), mod_entry_id.str() ); trim_and_print( w, point( 4, iNum - start ), wwidth, mod_entry_color, mod_entry_name ); - ent_map.emplace( std::distance( mods.begin(), iter ), + ent_map.emplace( static_cast( std::distance( mods.begin(), iter ) ), inclusive_rectangle( point( 1, iNum - start ), point( 3 + wwidth, iNum - start ) ) ); if( w_shift ) { @@ -1283,7 +1283,8 @@ int worldfactory::show_worldgen_tab_modselection( const catacurses::window &win, wputch( win, BORDER_COLOR, LINE_OXOX ); point tabpos( point( 2 + ++xpos, 4 ) ); int tabwidth = utf8_width( get_mod_list_tabs()[i].second.translated(), true ); - mod_tab_map.emplace( i, inclusive_rectangle( tabpos, tabpos + point( tabwidth, 0 ) ) ); + mod_tab_map.emplace( static_cast( i ), + inclusive_rectangle( tabpos, tabpos + point( tabwidth, 0 ) ) ); xpos += tabwidth + 2; } @@ -1734,7 +1735,7 @@ int worldfactory::show_worldgen_basic( WORLD *world ) colorize( "][", acc_clr ), _( "Finish" ), colorize( "]", acc_clr ) ); const point finish_pos( win_width / 4 - utf8_width( btn_txt, true ) / 2, y ); print_colored_text( w_confirmation, finish_pos, base_clr, base_clr, btn_txt ); - btn_map.emplace( wg_sliders.size() + 1, + btn_map.emplace( static_cast( wg_sliders.size() + 1 ), inclusive_rectangle( finish_pos, finish_pos + point( utf8_width( btn_txt, true ), 0 ) ) ); // Reset button acc_clr = get_clr( c_yellow, sel_opt == static_cast( wg_sliders.size() + 2 ) ); @@ -1745,7 +1746,7 @@ int worldfactory::show_worldgen_basic( WORLD *world ) colorize( "][", acc_clr ), _( "Reset" ), colorize( "]", acc_clr ) ); const point reset_pos( win_width / 2 - utf8_width( btn_txt, true ) / 2, y ); print_colored_text( w_confirmation, reset_pos, base_clr, base_clr, btn_txt ); - btn_map.emplace( wg_sliders.size() + 2, + btn_map.emplace( static_cast( wg_sliders.size() + 2 ), inclusive_rectangle( reset_pos, reset_pos + point( utf8_width( btn_txt, true ), 0 ) ) ); // Randomize button acc_clr = get_clr( c_yellow, sel_opt == static_cast( wg_sliders.size() + 3 ) ); @@ -1756,7 +1757,7 @@ int worldfactory::show_worldgen_basic( WORLD *world ) colorize( "][", acc_clr ), _( "Randomize" ), colorize( "]", acc_clr ) ); const point rand_pos( ( win_width * 3 ) / 4 - utf8_width( btn_txt, true ) / 2, y++ ); print_colored_text( w_confirmation, rand_pos, base_clr, base_clr, btn_txt ); - btn_map.emplace( wg_sliders.size() + 3, + btn_map.emplace( static_cast( wg_sliders.size() + 3 ), inclusive_rectangle( rand_pos, rand_pos + point( utf8_width( btn_txt, true ), 0 ) ) ); } @@ -1797,13 +1798,17 @@ int worldfactory::show_worldgen_basic( WORLD *world ) ctxt.get_desc( "ADVANCED_SETTINGS", 1U ) ); mvwprintz( w_confirmation, point( 2, win_height - 4 ), c_light_gray, _( "Advanced settings:" ) ); print_colored_text( w_confirmation, point( 2, win_height - 3 ), dummy, c_light_gray, sctxt ); - btn_map.emplace( wg_sliders.size() + 4, inclusive_rectangle( point( 2, win_height - 3 ), - point( 2 + utf8_width( sctxt, true ), win_height - 3 ) ) ); + btn_map.emplace( static_cast( wg_sliders.size() + 4 ), + inclusive_rectangle( + point( 2, win_height - 3 ), + point( 2 + utf8_width( sctxt, true ), win_height - 3 ) ) ); sctxt = string_format( _( "[%s] - Open mod manager" ), ctxt.get_desc( "PICK_MODS", 1U ) ); print_colored_text( w_confirmation, point( 2, win_height - 2 ), dummy, c_light_gray, sctxt ); - btn_map.emplace( wg_sliders.size() + 5, inclusive_rectangle( point( 2, win_height - 2 ), - point( 2 + utf8_width( sctxt, true ), win_height - 2 ) ) ); + btn_map.emplace( static_cast( wg_sliders.size() + 5 ), + inclusive_rectangle( + point( 2, win_height - 2 ), + point( 2 + utf8_width( sctxt, true ), win_height - 2 ) ) ); wnoutrefresh( w_confirmation ); } );