diff --git a/src/activity_actor.cpp b/src/activity_actor.cpp index 34c44c7d0790e..f38589d4e8a4d 100644 --- a/src/activity_actor.cpp +++ b/src/activity_actor.cpp @@ -4102,7 +4102,7 @@ void workout_activity_actor::serialize( JsonOut &jsout ) const std::unique_ptr workout_activity_actor::deserialize( JsonValue &jsin ) { - workout_activity_actor actor = workout_activity_actor( tripoint_zero ); + workout_activity_actor actor{ tripoint_bub_ms() }; JsonObject data = jsin.get_object(); @@ -4370,7 +4370,7 @@ void harvest_activity_actor::serialize( JsonOut &jsout ) const std::unique_ptr harvest_activity_actor::deserialize( JsonValue &jsin ) { - harvest_activity_actor actor( tripoint_zero ); + harvest_activity_actor actor{ tripoint_bub_ms() }; JsonObject jsobj = jsin.get_object(); jsobj.read( "target", actor.target ); diff --git a/src/activity_actor_definitions.h b/src/activity_actor_definitions.h index b097a93391909..0658aa0f1e4b8 100644 --- a/src/activity_actor_definitions.h +++ b/src/activity_actor_definitions.h @@ -869,7 +869,7 @@ class try_sleep_activity_actor : public activity_actor class safecracking_activity_actor : public activity_actor { public: - explicit safecracking_activity_actor( const tripoint &safe ) : safe( safe ) {}; + explicit safecracking_activity_actor( const tripoint_bub_ms &safe ) : safe( safe ) {}; activity_id get_type() const override { return activity_id( "ACT_CRACKING" ); @@ -889,7 +889,7 @@ class safecracking_activity_actor : public activity_actor static std::unique_ptr deserialize( JsonValue &jsin ); private: - tripoint safe; + tripoint_bub_ms safe; int exp_step = 0; bool can_resume_with_internal( const activity_actor &other, @@ -986,7 +986,7 @@ class workout_activity_actor : public activity_actor int elapsed = 0; public: - explicit workout_activity_actor( const tripoint &loc ) : location( loc ) {} + explicit workout_activity_actor( const tripoint_bub_ms &loc ) : location( loc ) {} // can assume different sub-activities activity_id get_type() const override { @@ -1120,7 +1120,7 @@ class stash_activity_actor: public activity_actor class harvest_activity_actor : public activity_actor { public: - explicit harvest_activity_actor( const tripoint &target, + explicit harvest_activity_actor( const tripoint_bub_ms &target, bool auto_forage = false ) : target( target ), auto_forage( auto_forage ) {}; @@ -1140,7 +1140,7 @@ class harvest_activity_actor : public activity_actor static std::unique_ptr deserialize( JsonValue &jsin ); private: - tripoint target; + tripoint_bub_ms target; bool exam_furn = false; bool nectar = false; bool auto_forage = false; diff --git a/src/activity_handlers.cpp b/src/activity_handlers.cpp index fea0c85f6fc92..1d34e6979c6dd 100644 --- a/src/activity_handlers.cpp +++ b/src/activity_handlers.cpp @@ -1666,8 +1666,8 @@ void activity_handlers::fill_liquid_do_turn( player_activity *act, Character *yo you->pour_into( act_ref.targets.at( 0 ), liquid, true ); break; case liquid_target_type::MAP: - if( iexamine::has_keg( act_ref.coords.at( 1 ) ) ) { - iexamine::pour_into_keg( act_ref.coords.at( 1 ), liquid ); + if( iexamine::has_keg( tripoint_bub_ms( act_ref.coords.at( 1 ) ) ) ) { + iexamine::pour_into_keg( tripoint_bub_ms( act_ref.coords.at( 1 ) ), liquid ); } else { here.add_item_or_charges( act_ref.coords.at( 1 ), liquid ); you->add_msg_if_player( _( "You pour %1$s onto the ground." ), liquid.tname() ); @@ -2893,7 +2893,7 @@ void activity_handlers::armor_layers_do_turn( player_activity *, Character *you void activity_handlers::atm_do_turn( player_activity *, Character *you ) { - iexamine::atm( *you, you->pos() ); + iexamine::atm( *you, you->pos_bub() ); } // fish-with-rod fish catching function. @@ -3569,7 +3569,7 @@ void activity_handlers::fertilize_plot_do_turn( player_activity *act, Character const auto reject_tile = [&]( const tripoint_bub_ms & tile ) { check_fertilizer(); // TODO: fix point types - ret_val can_fert = iexamine::can_fertilize( *you, tile.raw(), fertilizer ); + ret_val can_fert = iexamine::can_fertilize( *you, tile, fertilizer ); return !can_fert.success(); }; @@ -3577,7 +3577,7 @@ void activity_handlers::fertilize_plot_do_turn( player_activity *act, Character check_fertilizer(); if( have_fertilizer() ) { // TODO: fix point types - iexamine::fertilize_plant( you, tile.raw(), fertilizer ); + iexamine::fertilize_plant( you, tile, fertilizer ); if( !have_fertilizer() ) { add_msg( m_info, _( "You have run out of %s." ), item::nname( fertilizer ) ); } diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp index 1eeea3ef23298..6751479dac742 100644 --- a/src/activity_item_handling.cpp +++ b/src/activity_item_handling.cpp @@ -3002,10 +3002,10 @@ static bool generic_multi_activity_do( ( reason == do_activity_reason::NEEDS_CUT_HARVESTING ) ) && here.has_flag_furn( ter_furn_flag::TFLAG_GROWTH_HARVEST, src_loc ) ) { // TODO: fix point types - iexamine::harvest_plant( you, src_loc.raw(), true ); + iexamine::harvest_plant( you, src_loc, true ); } else if( ( reason == do_activity_reason::NEEDS_CLEARING ) && here.has_flag_furn( ter_furn_flag::TFLAG_GROWTH_OVERGROWN, src_loc ) ) { - iexamine::clear_overgrown( you, src_loc.raw() ); + iexamine::clear_overgrown( you, src_loc ); } else if( reason == do_activity_reason::NEEDS_TILLING && here.has_flag( ter_furn_flag::TFLAG_PLOWABLE, src_loc ) && you.has_quality( qual_DIG, 1 ) && !here.has_furn( src_loc ) ) { @@ -3029,7 +3029,7 @@ static bool generic_multi_activity_do( continue; } // TODO: fix point types - iexamine::plant_seed( you, src_loc.raw(), itype_id( seed ) ); + iexamine::plant_seed( you, src_loc, itype_id( seed ) ); you.backlog.emplace_front( act_id ); return false; } diff --git a/src/game.cpp b/src/game.cpp index 894d85f4eb2c6..befe9be368ad9 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -10503,7 +10503,7 @@ bool game::walk_move( const tripoint &dest_loc, const bool via_ramp, const bool if( !shifting_furniture && !pushing && is_dangerous_tile( dest_loc ) ) { std::vector harmful_stuff = get_dangerous_tile( dest_loc ); if( harmful_stuff.size() == 1 && harmful_stuff[0] == "ledge" ) { - iexamine::ledge( u, dest_loc ); + iexamine::ledge( u, tripoint_bub_ms( dest_loc ) ); return true; } else if( get_option( "DANGEROUS_TERRAIN_WARNING_PROMPT" ) == "ALWAYS" && !prompt_dangerous_tile( dest_loc ) ) { @@ -10912,7 +10912,7 @@ point game::place_player( const tripoint &dest_loc, bool quick ) const std::string forage_type = get_option( "AUTO_FORAGING" ); if( forage_type != "off" ) { - const auto forage = [&]( const tripoint & pos ) { + const auto forage = [&]( const tripoint_bub_ms & pos ) { const ter_t &xter_t = *m.ter( pos ); const furn_t &xfurn_t = *m.furn( pos ); const bool forage_everything = forage_type == "all"; @@ -10939,7 +10939,7 @@ point game::place_player( const tripoint &dest_loc, bool quick ) }; for( const direction &elem : adjacentDir ) { - forage( u.pos() + displace_XY( elem ) ); + forage( u.pos_bub() + displace_XY( elem ) ); } } diff --git a/src/handle_action.cpp b/src/handle_action.cpp index 849b5db04c642..600226d2f84c8 100644 --- a/src/handle_action.cpp +++ b/src/handle_action.cpp @@ -2732,7 +2732,7 @@ bool game::do_regular_action( action_id &act, avatar &player_character, break; case ACTION_WORKOUT: - player_character.assign_activity( workout_activity_actor( player_character.pos() ) ); + player_character.assign_activity( workout_activity_actor( player_character.pos_bub() ) ); break; case ACTION_SUICIDE: diff --git a/src/handle_liquid.cpp b/src/handle_liquid.cpp index 0756e13ba21a7..7334df31fc219 100644 --- a/src/handle_liquid.cpp +++ b/src/handle_liquid.cpp @@ -283,17 +283,17 @@ static bool get_liquid_target( item &liquid, const item *const source, const int } } - for( const tripoint &target_pos : here.points_in_radius( player_character.pos(), 1 ) ) { + for( const tripoint_bub_ms &target_pos : here.points_in_radius( player_character.pos_bub(), 1 ) ) { if( !iexamine::has_keg( target_pos ) ) { continue; } - if( source_pos != nullptr && *source_pos == target_pos ) { + if( source_pos != nullptr && *source_pos == target_pos.raw() ) { continue; } - const std::string dir = direction_name( direction_from( player_character.pos(), target_pos ) ); + const std::string dir = direction_name( direction_from( player_character.pos_bub(), target_pos ) ); menu.addentry( -1, true, MENU_AUTOASSIGN, _( "Pour into an adjacent keg (%s)" ), dir ); actions.emplace_back( [ &, target_pos]() { - target.pos = target_pos; + target.pos = target_pos.raw(); target.dest_opt = LD_KEG; } ); } @@ -437,7 +437,7 @@ bool perform_liquid_transfer( item &liquid, const tripoint *const source_pos, serialize_liquid_target( player_character.activity, target.pos ); } else { if( target.dest_opt == LD_KEG ) { - iexamine::pour_into_keg( target.pos, liquid ); + iexamine::pour_into_keg( tripoint_bub_ms( target.pos ), liquid ); } else { here.add_item_or_charges( target.pos, liquid ); liquid.charges = 0; diff --git a/src/iexamine.cpp b/src/iexamine.cpp index 33833e31a7fe4..def7418f069c2 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -310,29 +310,29 @@ static const time_duration milling_time = 6_hours; /** * Nothing player can interact with here. */ -void iexamine::none( Character &/*p*/, const tripoint &examp ) +void iexamine::none( Character &/*p*/, const tripoint_bub_ms &examp ) { add_msg( _( "That is a %s." ), get_map().name( examp ) ); } -bool iexamine::always_false( const tripoint &/*examp*/ ) +bool iexamine::always_false( const tripoint_bub_ms &/*examp*/ ) { return false; } -bool iexamine::false_and_debugmsg( const tripoint &examp ) +bool iexamine::false_and_debugmsg( const tripoint_bub_ms &examp ) { debugmsg( "Called false_and_debugmsg on %s - was a terrain with an actor configured incorrectly?", get_map().tername( examp ) ); return false; } -bool iexamine::always_true( const tripoint &/*examp*/ ) +bool iexamine::always_true( const tripoint_bub_ms &/*examp*/ ) { return true; } -bool iexamine::harvestable_now( const tripoint &examp ) +bool iexamine::harvestable_now( const tripoint_bub_ms &examp ) { const harvest_id hid = get_map().get_harvest( examp ); return !hid->is_null() && !hid->empty(); @@ -341,7 +341,7 @@ bool iexamine::harvestable_now( const tripoint &examp ) /** * Pick an appropriate item and apply diamond coating if possible. */ -void iexamine::cvdmachine( Character &you, const tripoint & ) +void iexamine::cvdmachine( Character &you, const tripoint_bub_ms & ) { // Select an item to which it is possible to apply a diamond coating item_location loc = g->inv_map_splice( []( const item & e ) { @@ -385,7 +385,7 @@ void iexamine::cvdmachine( Character &you, const tripoint & ) /** * Change player eye and skin color */ -void iexamine::change_appearance( Character &you, const tripoint & ) +void iexamine::change_appearance( Character &you, const tripoint_bub_ms & ) { uilist amenu; amenu.title = _( "Change what?" ); @@ -404,7 +404,7 @@ void iexamine::change_appearance( Character &you, const tripoint & ) * TEMPLATE FABRICATORS * Generate items from found blueprints. */ -void iexamine::nanofab( Character &you, const tripoint &examp ) +void iexamine::nanofab( Character &you, const tripoint_bub_ms &examp ) { bool table_exists = false; std::list on_table; @@ -412,8 +412,7 @@ void iexamine::nanofab( Character &you, const tripoint &examp ) tripoint_bub_ms spawn_point; map &here = get_map(); std::set allowed_template = here.ter( examp )->allowed_template_id; - for( const tripoint_bub_ms &valid_location : here.points_in_radius( tripoint_bub_ms( examp ), - 1 ) ) { + for( const tripoint_bub_ms &valid_location : here.points_in_radius( examp, 1 ) ) { if( here.has_flag( ter_furn_flag::TFLAG_NANOFAB_TABLE, valid_location ) ) { spawn_point = valid_location; table_exists = true; @@ -529,7 +528,7 @@ void iexamine::nanofab( Character &you, const tripoint &examp ) /// @brief Use "gas pump." /// @details Will pump any liquids on tile. -void iexamine::gaspump( Character &you, const tripoint &examp ) +void iexamine::gaspump( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); if( !query_yn( _( "Use the %s?" ), here.tername( examp ) ) ) { @@ -557,7 +556,7 @@ void iexamine::gaspump( Character &you, const tripoint &examp ) } } else { - liquid_handler::handle_liquid_from_ground( item_it, examp, 1 ); + liquid_handler::handle_liquid_from_ground( item_it, examp.raw(), 1 ); } return; } @@ -582,7 +581,7 @@ static bool has_attunement_spell_prereqs( Character &you, const trait_id &attune return true; } -void iexamine::attunement_altar( Character &you, const tripoint & ) +void iexamine::attunement_altar( Character &you, const tripoint_bub_ms & ) { std::set attunements; for( const mutation_branch &mut : mutation_branch::get_all() ) { @@ -660,7 +659,7 @@ void iexamine::attunement_altar( Character &you, const tripoint & ) } } -void iexamine::translocator( Character &, const tripoint &examp ) +void iexamine::translocator( Character &, const tripoint_bub_ms &examp ) { /// @todo fix point types const tripoint_abs_omt omt_loc( ms_to_omt_copy( get_map().getabs( examp ) ) ); @@ -1022,7 +1021,7 @@ class atm_menu /** * launches the atm menu class which then handles all the atm interactions. */ -void iexamine::atm( Character &you, const tripoint & ) +void iexamine::atm( Character &you, const tripoint_bub_ms & ) { atm_menu {you}.start(); } @@ -1030,7 +1029,7 @@ void iexamine::atm( Character &you, const tripoint & ) /** * Generates vending machine UI and allows players to purchase contained items with a cash card. */ -void iexamine::vending( Character &you, const tripoint &examp ) +void iexamine::vending( Character &you, const tripoint_bub_ms &examp ) { constexpr int moves_cost = to_moves( 5_seconds ); int money = you.charges_of( itype_cash_card ); @@ -1230,8 +1229,8 @@ tripoint _rotate_point_sm( tripoint const &p, int erot, tripoint const &orig ) constexpr int uilist_positive = 10000; // workaround for uilist retval autoassign when retval == -1 -int _choose_elevator_destz( tripoint const &examp, tripoint_abs_omt const &this_omt, - tripoint const &sm_orig ) +int _choose_elevator_destz( tripoint_bub_ms const &examp, tripoint_abs_omt const &this_omt, + tripoint_bub_ms const &sm_orig ) { map &here = get_map(); uilist choice; @@ -1239,14 +1238,14 @@ int _choose_elevator_destz( tripoint const &examp, tripoint_abs_omt const &this_ for( int z = OVERMAP_HEIGHT; z >= -OVERMAP_DEPTH; z-- ) { tripoint_abs_omt const that_omt( this_omt.xy(), z ); tripoint const zp = - _rotate_point_sm( { examp.xy(), z }, _get_rot_delta( this_omt, that_omt ), sm_orig ); + _rotate_point_sm( { examp.xy().raw(), z}, _get_rot_delta( this_omt, that_omt ), sm_orig.raw() ); if( here.ter( zp )->has_examine( iexamine::elevator ) ) { std::string const omt_name = overmap_buffer.ter_existing( that_omt )->get_name( om_vision_level::full ); std::string const name = string_format( - "%i %s%s", z, omt_name, z == examp.z ? _( " (this floor)" ) : std::string() ); - choice.addentry( z + uilist_positive, z != examp.z, MENU_AUTOASSIGN, name ); + "%i %s%s", z, omt_name, z == examp.z() ? _( " (this floor)" ) : std::string() ); + choice.addentry( z + uilist_positive, z != examp.z(), MENU_AUTOASSIGN, name ); } } choice.query(); @@ -1258,7 +1257,7 @@ struct elevator_vehicles { std::vector v; }; -elevator_vehicles _get_vehicles_on_elevator( std::vector const &elevator ) +elevator_vehicles _get_vehicles_on_elevator( std::vector const &elevator ) { std::vector ret; VehicleList const vehs = get_map().get_vehicles(); @@ -1266,7 +1265,7 @@ elevator_vehicles _get_vehicles_on_elevator( std::vector const &elevat bool inbounds = true; bool can_block = false; for( const vpart_reference &vp : v.v->get_all_parts() ) { - tripoint const p = v.pos + vp.part().precalc[0]; + tripoint_bub_ms const p = tripoint_bub_ms( v.pos + vp.part().precalc[0] ); auto const eit = std::find( elevator.cbegin(), elevator.cend(), p ); inbounds &= eit != elevator.cend(); if( !inbounds ) { @@ -1285,21 +1284,21 @@ elevator_vehicles _get_vehicles_on_elevator( std::vector const &elevat } } // namespace -void iexamine::elevator( Character &you, const tripoint &examp ) +void iexamine::elevator( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); tripoint_abs_ms const old_abs_pos = you.get_location(); tripoint_abs_omt const this_omt = project_to( here.getglobal( examp ) ); - tripoint const sm_orig = here.getlocal( project_to( this_omt ) ); - std::vector this_elevator; + tripoint_bub_ms const sm_orig = here.bub_from_abs( project_to( this_omt ) ); + std::vector this_elevator; - for( tripoint const &pos : closest_points_first( examp, SEEX - 1 ) ) { + for( tripoint_bub_ms const &pos : closest_points_first( examp, SEEX - 1 ) ) { if( here.has_flag( ter_furn_flag::TFLAG_ELEVATOR, pos ) ) { this_elevator.emplace_back( pos ); } } - auto const uit = std::find( this_elevator.cbegin(), this_elevator.cend(), you.pos() ); + auto const uit = std::find( this_elevator.cbegin(), this_elevator.cend(), you.pos_bub() ); if( uit == this_elevator.cend() ) { popup( _( "You must stand inside the elevator to use it." ) ); return; @@ -1318,19 +1317,19 @@ void iexamine::elevator( Character &you, const tripoint &examp ) tripoint_abs_omt const that_omt( this_omt.xy(), movez ); int const erot = _get_rot_delta( this_omt, that_omt ); - std::vector that_elevator; + std::vector that_elevator; std::transform( this_elevator.begin(), this_elevator.end(), std::back_inserter( that_elevator ), - [&erot, &sm_orig, &movez]( tripoint const & p ) { - return _rotate_point_sm( { p.xy(), movez }, erot, sm_orig ); + [&erot, &sm_orig, &movez]( tripoint_bub_ms const & p ) { + return tripoint_bub_ms( _rotate_point_sm( { p.xy().raw(), movez}, erot, sm_orig.raw() ) ); } ); creature_tracker &creatures = get_creature_tracker(); // first find critters in the destination elevator and move them out of the way for( Creature &critter : g->all_creatures() ) { - tripoint const cr_pos = here.getlocal( critter.get_location() ); + tripoint_bub_ms const cr_pos = critter.pos_bub(); auto const eit = std::find( that_elevator.cbegin(), that_elevator.cend(), cr_pos ); if( eit != that_elevator.cend() ) { - for( const tripoint &candidate : closest_points_first( *eit, 10 ) ) { + for( const tripoint_bub_ms &candidate : closest_points_first( *eit, 10 ) ) { if( !here.has_flag( ter_furn_flag::TFLAG_ELEVATOR, candidate ) && here.passable( candidate ) && creatures.creature_at( candidate ) == nullptr ) { @@ -1358,14 +1357,14 @@ void iexamine::elevator( Character &you, const tripoint &examp ) // move along all creatures on the elevator for( Creature &critter : g->all_creatures() ) { - auto const eit = std::find( this_elevator.cbegin(), this_elevator.cend(), critter.pos() ); + auto const eit = std::find( this_elevator.cbegin(), this_elevator.cend(), critter.pos_bub() ); if( eit != this_elevator.cend() ) { critter.setpos( that_elevator[ std::distance( this_elevator.cbegin(), eit ) ] ); } } for( vehicle *v : vehs.v ) { - tripoint const p = _rotate_point_sm( { v->global_pos3().xy(), movez }, erot, sm_orig ); + tripoint const p = _rotate_point_sm( { v->global_pos3().xy(), movez }, erot, sm_orig.raw() ); here.displace_vehicle( *v, p - v->global_pos3() ); v->turn( erot * 90_degrees ); v->face = tileray( v->turn_dir ); @@ -1382,7 +1381,7 @@ void iexamine::elevator( Character &you, const tripoint &examp ) /** * Open gate. */ -void iexamine::controls_gate( Character &you, const tripoint &examp ) +void iexamine::controls_gate( Character &you, const tripoint_bub_ms &examp ) { if( !query_yn( _( "Use the %s?" ), get_map().tername( examp ) ) ) { none( you, examp ); @@ -1418,7 +1417,7 @@ bool iexamine::try_start_hacking( Character &you, const tripoint_bub_ms &examp ) } } -void iexamine::cardreader_robofac( Character &you, const tripoint &examp ) +void iexamine::cardreader_robofac( Character &you, const tripoint_bub_ms &examp ) { itype_id card_type = itype_id_science; if( you.has_amount( card_type, 1 ) && query_yn( _( "Swipe your ID card?" ) ) ) { @@ -1432,7 +1431,7 @@ void iexamine::cardreader_robofac( Character &you, const tripoint &examp ) } } -void iexamine::cardreader_foodplace( Character &you, const tripoint &examp ) +void iexamine::cardreader_foodplace( Character &you, const tripoint_bub_ms &examp ) { bool open = false; if( ( you.is_wearing( itype_foodperson_mask ) || @@ -1480,10 +1479,10 @@ void iexamine::cardreader_foodplace( Character &you, const tripoint &examp ) } } -void iexamine::intercom( Character &you, const tripoint &examp ) +void iexamine::intercom( Character &you, const tripoint_bub_ms &examp ) { const std::vector intercom_npcs = g->get_npcs_if( [examp]( const npc & guy ) { - return guy.myclass == NC_ROBOFAC_INTERCOM && rl_dist( guy.pos(), examp ) < 10; + return guy.myclass == NC_ROBOFAC_INTERCOM && rl_dist( guy.pos_bub(), examp ) < 10; } ); if( intercom_npcs.empty() ) { you.add_msg_if_player( m_info, _( "No one responds." ) ); @@ -1496,7 +1495,7 @@ void iexamine::intercom( Character &you, const tripoint &examp ) /** * Prompt removal of rubble. Select best shovel and invoke "CLEAR_RUBBLE" on tile. */ -void iexamine::rubble( Character &you, const tripoint &examp ) +void iexamine::rubble( Character &you, const tripoint_bub_ms &examp ) { int moves; if( you.has_quality( qual_DIG, 3 ) || you.has_trait( trait_BURROW ) || @@ -1521,7 +1520,7 @@ void iexamine::rubble( Character &you, const tripoint &examp ) /** * Prompt climbing over fence. Calculates move cost, applies it to player and moves them. */ -void iexamine::chainfence( Character &you, const tripoint &examp ) +void iexamine::chainfence( Character &you, const tripoint_bub_ms &examp ) { // If player is grabbed, trapped, or somehow otherwise movement-impeded, first try to break free if( !you.move_effects( false ) ) { @@ -1549,7 +1548,7 @@ void iexamine::chainfence( Character &you, const tripoint &examp ) // We're not going to do anything if we're already on that point. // Also prompt the player before taking an action. - if( you.pos() == examp || !query_yn( _( "Climb obstacle?" ) ) ) { + if( you.pos_bub() == examp || !query_yn( _( "Climb obstacle?" ) ) ) { none( you, examp ); return; } @@ -1598,8 +1597,8 @@ void iexamine::chainfence( Character &you, const tripoint &examp ) here.unboard_vehicle( you.pos_bub() ); } you.setpos( examp ); - if( examp.x < HALF_MAPSIZE_X || examp.y < HALF_MAPSIZE_Y || - examp.x >= HALF_MAPSIZE_X + SEEX || examp.y >= HALF_MAPSIZE_Y + SEEY ) { + if( examp.x() < HALF_MAPSIZE_X || examp.y() < HALF_MAPSIZE_Y || + examp.x() >= HALF_MAPSIZE_X + SEEX || examp.y() >= HALF_MAPSIZE_Y + SEEY ) { if( you.is_avatar() ) { g->update_map( you ); } @@ -1609,7 +1608,7 @@ void iexamine::chainfence( Character &you, const tripoint &examp ) /** * If player has amorphous trait, slip through the bars. */ -void iexamine::bars( Character &you, const tripoint &examp ) +void iexamine::bars( Character &you, const tripoint_bub_ms &examp ) { if( !you.has_trait( trait_AMORPHOUS ) ) { none( you, examp ); @@ -1633,13 +1632,13 @@ void iexamine::bars( Character &you, const tripoint &examp ) you.setpos( examp ); } -void iexamine::deployed_furniture( Character &you, const tripoint &pos ) +void iexamine::deployed_furniture( Character &you, const tripoint_bub_ms &pos ) { map &here = get_map(); - tripoint_bub_ms drop_pos = tripoint_bub_ms( pos ); + tripoint_bub_ms drop_pos = pos; - if( you.pos().z != pos.z ) { + if( you.pos_bub().z() != pos.z() ) { drop_pos = you.pos_bub(); if( !you.query_yn( _( "Pull up the %s?" ), here.furn( pos ).obj().name() ) ) { return; @@ -1682,7 +1681,7 @@ static std::pair find_tent_itype( const fur /** * Determine structure's type and prompts its removal. */ -void iexamine::portable_structure( Character &you, const tripoint &examp ) +void iexamine::portable_structure( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const furn_str_id fid = here.furn( examp ).id(); @@ -1717,15 +1716,14 @@ void iexamine::portable_structure( Character &you, const tripoint &examp ) return; } - tent_deconstruct_activity_actor actor( to_moves( 20_minutes ), radius, - tripoint_bub_ms( examp ), dropped ); + tent_deconstruct_activity_actor actor( to_moves( 20_minutes ), radius, examp, dropped ); you.assign_activity( actor ); } /** * If there is a 2x4 around, prompt placing it across pit. */ -void iexamine::pit( Character &you, const tripoint &examp ) +void iexamine::pit( Character &you, const tripoint_bub_ms &examp ) { const inventory &crafting_inv = you.crafting_inventory(); if( !crafting_inv.has_amount( itype_2x4, 1 ) ) { @@ -1754,7 +1752,7 @@ void iexamine::pit( Character &you, const tripoint &examp ) /** * Prompt removing the 2x4 placed across the pit */ -void iexamine::pit_covered( Character &you, const tripoint &examp ) +void iexamine::pit_covered( Character &you, const tripoint_bub_ms &examp ) { if( !query_yn( _( "Remove cover?" ) ) ) { none( you, examp ); @@ -1785,7 +1783,7 @@ void iexamine::pit_covered( Character &you, const tripoint &examp ) * Time per attempt affected by perception and mechanics. 30 minutes per attempt minimum. * Small chance of just guessing the combo without listening device. */ -void iexamine::safe( Character &you, const tripoint &examp ) +void iexamine::safe( Character &you, const tripoint_bub_ms &examp ) { bool has_cracking_tool = you.has_flag( json_flag_SAFECRACK_NO_TOOL ); // short-circuit to avoid the more expensive iteration over items @@ -1825,17 +1823,17 @@ void iexamine::safe( Character &you, const tripoint &examp ) /** * Attempt to "hack" the gunsafe's electronic lock and open it. */ -void iexamine::gunsafe_el( Character &you, const tripoint &examp ) +void iexamine::gunsafe_el( Character &you, const tripoint_bub_ms &examp ) { if( query_yn( _( "Attempt to hack this safe?" ) ) ) { - try_start_hacking( you, tripoint_bub_ms( examp ) ); + try_start_hacking( you, examp ); } } /** * Checks whether PC has a crowbar then calls iuse.crowbar. */ -void iexamine::locked_object( Character &you, const tripoint &examp ) +void iexamine::locked_object( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); item &best_prying = you.best_item_with_quality( qual_PRY ); @@ -1898,7 +1896,7 @@ void iexamine::locked_object( Character &you, const tripoint &examp ) //~ %1$s: terrain/furniture name, %2$s: prying tool name you.add_msg_if_player( _( "You attempt to pry open the %1$s using your %2$s…" ), target_name, best_prying.tname() ); - iuse::crowbar( &you, &best_prying, examp ); + iuse::crowbar( &you, &best_prying, examp.raw() ); } else if( action == act::pick ) { locked_object_pickable( you, examp ); } @@ -1907,7 +1905,7 @@ void iexamine::locked_object( Character &you, const tripoint &examp ) /** * Checks whether PC has picklocks then calls pick_lock iuse function OR assigns ACT_LOCKPICK */ -void iexamine::locked_object_pickable( Character &you, const tripoint &examp ) +void iexamine::locked_object_pickable( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const optional_vpart_position veh = here.veh_at( examp ); @@ -1970,7 +1968,7 @@ void iexamine::locked_object_pickable( Character &you, const tripoint &examp ) const use_function *iuse_fn = it->type->get_use( "PICK_LOCK" ); you.add_msg_if_player( _( "You attempt to pick the lock of %1$s using your %2$s…" ), target_name, it->tname() ); - const ret_val can_use = iuse_fn->can_call( you, *it, examp ); + const ret_val can_use = iuse_fn->can_call( you, *it, examp.raw() ); if( can_use.success() ) { iuse_fn->call( &you, *it, examp ); return; @@ -1980,7 +1978,7 @@ void iexamine::locked_object_pickable( Character &you, const tripoint &examp ) } } -void iexamine::bulletin_board( Character &you, const tripoint &examp ) +void iexamine::bulletin_board( Character &you, const tripoint_bub_ms &examp ) { g->validate_camps(); map &here = get_map(); @@ -2037,7 +2035,7 @@ void iexamine::bulletin_board( Character &you, const tripoint &examp ) /** * Spawn 1d4 wyrms and sink pedestal into ground. */ -void iexamine::pedestal_wyrm( Character &you, const tripoint &examp ) +void iexamine::pedestal_wyrm( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); map_stack items = here.i_at( examp ); @@ -2074,7 +2072,7 @@ void iexamine::pedestal_wyrm( Character &you, const tripoint &examp ) /** * Put petrified eye on pedestal causing it to sink into ground and open temple. */ -void iexamine::pedestal_temple( Character &you, const tripoint &examp ) +void iexamine::pedestal_temple( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); map_stack items = here.i_at( examp ); @@ -2098,7 +2096,7 @@ void iexamine::pedestal_temple( Character &you, const tripoint &examp ) /** * Unlock/open door or attempt to peek through peephole. */ -void iexamine::door_peephole( Character &you, const tripoint &examp ) +void iexamine::door_peephole( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); if( here.is_outside( you.pos_bub() ) ) { @@ -2119,7 +2117,7 @@ void iexamine::door_peephole( Character &you, const tripoint &examp ) } ); if( choice == 0 ) { // Peek - g->peek( tripoint_bub_ms( examp ) ); + g->peek( examp ); you.add_msg_if_player( _( "You peek through the peephole." ) ); } else if( choice == 1 ) { here.open_door( you, examp, true, false ); @@ -2129,7 +2127,7 @@ void iexamine::door_peephole( Character &you, const tripoint &examp ) } } -void iexamine::fswitch( Character &you, const tripoint &examp ) +void iexamine::fswitch( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); if( !query_yn( _( "Flip the %s?" ), here.tername( examp ) ) ) { @@ -2139,8 +2137,8 @@ void iexamine::fswitch( Character &you, const tripoint &examp ) ter_id terid = here.ter( examp ); you.mod_moves( -to_moves( 1_seconds ) ); tripoint tmp; - tmp.z = examp.z; - for( tmp.y = examp.y; tmp.y <= examp.y + 5; tmp.y++ ) { + tmp.z = examp.z(); + for( tmp.y = examp.y(); tmp.y <= examp.y() + 5; tmp.y++ ) { for( tmp.x = 0; tmp.x < MAPSIZE_X; tmp.x++ ) { const ter_id &nearby_ter = here.ter( tmp ); if( terid == ter_t_switch_rg ) { @@ -2174,7 +2172,7 @@ void iexamine::fswitch( Character &you, const tripoint &examp ) here.ter_set( tmp, ter_t_rock_red ); } } else if( terid == ter_t_switch_even ) { - if( ( tmp.y - examp.y ) % 2 == 1 ) { + if( ( tmp.y - examp.y() ) % 2 == 1 ) { if( nearby_ter == ter_t_rock_red ) { here.ter_set( tmp, ter_t_floor_red ); } else if( nearby_ter == ter_t_floor_red ) { @@ -2199,7 +2197,7 @@ void iexamine::fswitch( Character &you, const tripoint &examp ) /** * If it's winter: show msg and return true. Otherwise return false */ -static bool dead_plant( bool flower, Character &you, const tripoint &examp ) +static bool dead_plant( bool flower, Character &you, const tripoint_bub_ms &examp ) { if( season_of_year( calendar::turn ) == WINTER ) { if( flower ) { @@ -2266,7 +2264,7 @@ void iexamine_helper::handle_harvest( Character &you, const std::string &itemid, * Drinking causes: -25 hunger, +20 sleepiness, pkill2-70 effect and, 1 in 20 pkiller-1 addiction. * Picking w/ env_resist < 5 causes 1 in 3 sleep for 12 min and 4 dmg to each leg */ -void iexamine::flower_poppy( Character &you, const tripoint &examp ) +void iexamine::flower_poppy( Character &you, const tripoint_bub_ms &examp ) { if( dead_plant( true, you, examp ) ) { return; @@ -2325,7 +2323,7 @@ void iexamine::flower_poppy( Character &you, const tripoint &examp ) /** * Prompt pick cactus pad. Not safe for player. */ -void iexamine::flower_cactus( Character &you, const tripoint &examp ) +void iexamine::flower_cactus( Character &you, const tripoint_bub_ms &examp ) { if( dead_plant( true, you, examp ) ) { return; @@ -2352,7 +2350,7 @@ void iexamine::flower_cactus( Character &you, const tripoint &examp ) /** * Dig up its roots or drink its nectar if you can. */ -void iexamine::flower_dahlia( Character &you, const tripoint &examp ) +void iexamine::flower_dahlia( Character &you, const tripoint_bub_ms &examp ) { if( dead_plant( true, you, examp ) ) { return; @@ -2389,7 +2387,7 @@ void iexamine::flower_dahlia( Character &you, const tripoint &examp ) // But those were useless, don't re-add until they get useful } -static bool query_pick( Character &who, const tripoint &target ) +static bool query_pick( Character &who, const tripoint_bub_ms &target ) { if( !who.is_avatar() ) { return false; @@ -2419,7 +2417,7 @@ static bool query_pick( Character &who, const tripoint &target ) return true; } -void iexamine::harvest_furn_nectar( Character &you, const tripoint &examp ) +void iexamine::harvest_furn_nectar( Character &you, const tripoint_bub_ms &examp ) { bool auto_forage = get_option( "AUTO_FEATURES" ) && get_option( "AUTO_FORAGING" ) == "all"; @@ -2429,7 +2427,7 @@ void iexamine::harvest_furn_nectar( Character &you, const tripoint &examp ) you.assign_activity( harvest_activity_actor( examp, auto_forage ) ); } -void iexamine::harvest_furn( Character &you, const tripoint &examp ) +void iexamine::harvest_furn( Character &you, const tripoint_bub_ms &examp ) { bool auto_forage = get_option( "AUTO_FEATURES" ) && get_option( "AUTO_FORAGING" ) == "all"; @@ -2439,7 +2437,7 @@ void iexamine::harvest_furn( Character &you, const tripoint &examp ) you.assign_activity( harvest_activity_actor( examp, auto_forage ) ); } -void iexamine::harvest_ter_nectar( Character &you, const tripoint &examp ) +void iexamine::harvest_ter_nectar( Character &you, const tripoint_bub_ms &examp ) { bool auto_forage = get_option( "AUTO_FEATURES" ) && ( get_option( "AUTO_FORAGING" ) == "all" || @@ -2451,7 +2449,7 @@ void iexamine::harvest_ter_nectar( Character &you, const tripoint &examp ) you.assign_activity( harvest_activity_actor( examp, auto_forage ) ); } -void iexamine::harvest_ter( Character &you, const tripoint &examp ) +void iexamine::harvest_ter( Character &you, const tripoint_bub_ms &examp ) { bool auto_forage = get_option( "AUTO_FEATURES" ) && ( get_option( "AUTO_FORAGING" ) == "all" || @@ -2465,13 +2463,13 @@ void iexamine::harvest_ter( Character &you, const tripoint &examp ) /** * Only harvest a plant once per season. Display message and call iexamine::none. */ -void iexamine::harvested_plant( Character &you, const tripoint &examp ) +void iexamine::harvested_plant( Character &you, const tripoint_bub_ms &examp ) { you.add_msg_if_player( m_info, _( "Nothing can be harvested from this plant in current season" ) ); iexamine::none( you, examp ); } -void iexamine::flower_marloss( Character &you, const tripoint &examp ) +void iexamine::flower_marloss( Character &you, const tripoint_bub_ms &examp ) { if( season_of_year( calendar::turn ) == WINTER ) { add_msg( m_info, _( "This flower is still alive, despite the harsh conditions…" ) ); @@ -2500,11 +2498,11 @@ void iexamine::flower_marloss( Character &you, const tripoint &examp ) /** * Remove furniture. Add spore effect. */ -void iexamine::fungus( Character &you, const tripoint &examp ) +void iexamine::fungus( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); add_msg( _( "The %s crumbles into spores!" ), here.furnname( examp ) ); - fungal_effects().create_spores( tripoint_bub_ms( examp ), &you ); + fungal_effects().create_spores( examp, &you ); here.furn_set( examp, furn_str_id::NULL_ID() ); you.mod_moves( -to_moves( 1_seconds ) * 0.5 ); } @@ -2566,7 +2564,7 @@ int iexamine::query_seed( const std::vector &seed_entries ) /** * Actual planting of selected seed */ -void iexamine::plant_seed( Character &you, const tripoint &examp, const itype_id &seed_id ) +void iexamine::plant_seed( Character &you, const tripoint_bub_ms &examp, const itype_id &seed_id ) { player_activity act( ACT_PLANT_SEED, to_moves( 30_seconds ) ); act.placement = get_map().getglobal( examp ); @@ -2577,7 +2575,7 @@ void iexamine::plant_seed( Character &you, const tripoint &examp, const itype_id /** * If it's warm enough, pick one of the player's seeds and plant it. */ -void iexamine::dirtmound( Character &you, const tripoint &examp ) +void iexamine::dirtmound( Character &you, const tripoint_bub_ms &examp ) { if( !warm_enough_to_plant( get_player_character().pos() ) ) { @@ -2670,7 +2668,7 @@ std::list iexamine::get_harvest_items( const itype &type, const int plant_ } // Cleaning up plants that have decayed and overgrown -void iexamine::clear_overgrown( Character &you, const tripoint &examp ) +void iexamine::clear_overgrown( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); @@ -2688,7 +2686,7 @@ void iexamine::clear_overgrown( Character &you, const tripoint &examp ) } // Only harvest, used for autoforaging -void iexamine::harvest_plant_ex( Character &you, const tripoint &examp ) +void iexamine::harvest_plant_ex( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); // Can't use item_stack::only_item() since there might be fertilizer @@ -2698,7 +2696,7 @@ void iexamine::harvest_plant_ex( Character &you, const tripoint &examp ) } ); if( seed == items.end() ) { - debugmsg( "Missing seed for plant at (%d, %d, %d)", examp.x, examp.y, examp.z ); + debugmsg( "Missing seed for plant at %s", examp.to_string() ); here.i_clear( examp ); here.furn_set( examp, furn_str_id::NULL_ID() ); return; @@ -2712,7 +2710,7 @@ void iexamine::harvest_plant_ex( Character &you, const tripoint &examp ) /** * Actual harvesting of selected plant */ -void iexamine::harvest_plant( Character &you, const tripoint &examp, bool from_activity ) +void iexamine::harvest_plant( Character &you, const tripoint_bub_ms &examp, bool from_activity ) { map &here = get_map(); // Can't use item_stack::only_item() since there might be fertilizer @@ -2722,7 +2720,7 @@ void iexamine::harvest_plant( Character &you, const tripoint &examp, bool from_a } ); if( seed == items.end() ) { - debugmsg( "Missing seed for plant at (%d, %d, %d)", examp.x, examp.y, examp.z ); + debugmsg( "Missing seed for plant at %s", examp.to_string() ); here.i_clear( examp ); here.furn_set( examp, furn_str_id::NULL_ID() ); return; @@ -2781,7 +2779,7 @@ void iexamine::harvest_plant( Character &you, const tripoint &examp, bool from_a } } -ret_val iexamine::can_fertilize( Character &you, const tripoint &tile, +ret_val iexamine::can_fertilize( Character &you, const tripoint_bub_ms &tile, const itype_id &fertilizer ) { map &here = get_map(); @@ -2801,7 +2799,7 @@ ret_val iexamine::can_fertilize( Character &you, const tripoint &tile, return ret_val::make_success(); } -void iexamine::fertilize_plant( Character &you, const tripoint &tile, +void iexamine::fertilize_plant( Character &you, const tripoint_bub_ms &tile, const itype_id &fertilizer ) { ret_val can_fert = can_fertilize( you, tile, fertilizer ); @@ -2828,7 +2826,7 @@ void iexamine::fertilize_plant( Character &you, const tripoint &tile, return it.is_seed(); } ); if( seed == items.end() ) { - debugmsg( "Missing seed for plant at (%d, %d, %d)", tile.x, tile.y, tile.z ); + debugmsg( "Missing seed for plant at %s", tile.to_string() ); here.i_clear( tile ); here.furn_set( tile, furn_str_id::NULL_ID() ); return; @@ -2884,7 +2882,7 @@ itype_id iexamine::choose_fertilizer( Character &you, const std::string &pname, return f_types[f_index]; } -void iexamine::aggie_plant( Character &you, const tripoint &examp ) +void iexamine::aggie_plant( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); // Can't use item_stack::only_item() since there might be fertilizer @@ -2894,7 +2892,7 @@ void iexamine::aggie_plant( Character &you, const tripoint &examp ) } ); if( seed == items.end() ) { - debugmsg( "Missing seed for plant at (%d, %d, %d)", examp.x, examp.y, examp.z ); + debugmsg( "Missing seed for plant at %s", examp.to_string() ); here.i_clear( examp ); here.furn_set( examp, furn_str_id::NULL_ID() ); return; @@ -2919,7 +2917,7 @@ void iexamine::aggie_plant( Character &you, const tripoint &examp ) } // Highly modified fermenting vat functions -void iexamine::kiln_empty( Character &you, const tripoint &examp ) +void iexamine::kiln_empty( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_kiln_type = here.furn( examp ); @@ -3012,7 +3010,7 @@ void iexamine::kiln_empty( Character &you, const tripoint &examp ) } } -void iexamine::kiln_full( Character &, const tripoint &examp ) +void iexamine::kiln_full( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_kiln_type = here.furn( examp ); @@ -3072,7 +3070,7 @@ void iexamine::kiln_full( Character &, const tripoint &examp ) add_msg( _( "It has finished burning, yielding %d charcoal." ), result.charges ); } //arc furnance start -void iexamine::arcfurnace_empty( Character &you, const tripoint &examp ) +void iexamine::arcfurnace_empty( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_arcfurnace_type = here.furn( examp ); @@ -3145,7 +3143,7 @@ void iexamine::arcfurnace_empty( Character &you, const tripoint &examp ) add_msg( _( "You turn on the furnace." ) ); } -void iexamine::arcfurnace_full( Character &, const tripoint &examp ) +void iexamine::arcfurnace_full( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_arcfurnace_type = here.furn( examp ); @@ -3204,7 +3202,7 @@ void iexamine::arcfurnace_full( Character &, const tripoint &examp ) } //arc furnace end -void iexamine::stook_empty( Character &, const tripoint &examp ) +void iexamine::stook_empty( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_stook_type = here.furn( examp ); @@ -3246,7 +3244,7 @@ void iexamine::stook_empty( Character &, const tripoint &examp ) add_msg( _( "You set up the stook and leave it to dry." ) ); } -void iexamine::stook_full( Character &, const tripoint &examp ) +void iexamine::stook_full( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_stook_type = here.furn( examp ); @@ -3293,7 +3291,7 @@ void iexamine::stook_full( Character &, const tripoint &examp ) here.furn_set( examp, next_stook_type ); } -void iexamine::autoclave_empty( Character &you, const tripoint &examp ) +void iexamine::autoclave_empty( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_autoclave_type = here.furn( examp ); @@ -3353,7 +3351,7 @@ void iexamine::autoclave_empty( Character &you, const tripoint &examp ) } } -void iexamine::autoclave_full( Character &, const tripoint &examp ) +void iexamine::autoclave_full( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_autoclave_type = here.furn( examp ); @@ -3412,18 +3410,18 @@ void iexamine::autoclave_full( Character &, const tripoint &examp ) } static void add_firestarter( item *it, std::multimap &firestarters, Character &you, - const tripoint &examp ) + const tripoint_bub_ms &examp ) { const use_function *usef = it->type->get_use( "firestarter" ); if( usef != nullptr && usef->get_actor_ptr() != nullptr ) { const firestarter_actor *actor = dynamic_cast( usef->get_actor_ptr() ); - if( actor->can_use( you, *it, examp ).success() ) { + if( actor->can_use( you, *it, examp.raw() ).success() ) { firestarters.insert( std::pair( actor->moves_cost_fast, it ) ); } } } -void iexamine::fireplace( Character &you, const tripoint &examp ) +void iexamine::fireplace( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const bool already_on_fire = here.has_nearby_fire( examp, 0 ); @@ -3444,7 +3442,7 @@ void iexamine::fireplace( Character &you, const tripoint &examp ) } for( const tripoint_bub_ms &pos : closest_points_first( you.pos_bub(), PICKUP_RANGE ) ) { - if( pos.raw() == examp ) { + if( pos == examp ) { // stuff in the fireplace can't light or quench itself continue; } @@ -3496,9 +3494,9 @@ void iexamine::fireplace( Character &you, const tripoint &examp ) const use_function *usef = it->type->get_use( "firestarter" ); const firestarter_actor *actor = dynamic_cast( usef->get_actor_ptr() ); you.add_msg_if_player( _( "You attempt to start a fire with your %s…" ), it->tname() ); - const ret_val can_use = actor->can_use( you, *it, examp ); + const ret_val can_use = actor->can_use( you, *it, examp.raw() ); if( can_use.success() ) { - const int charges = actor->use( &you, *it, examp ).value_or( 0 ); + const int charges = actor->use( &you, *it, examp.raw() ).value_or( 0 ); you.use_charges( it->typeId(), charges ); return; } else { @@ -3543,7 +3541,7 @@ void iexamine::fireplace( Character &you, const tripoint &examp ) } } -static void fvat_set_empty( const tripoint &pos ) +static void fvat_set_empty( const tripoint_bub_ms &pos ) { map &here = get_map(); furn_id furn = here.furn( pos ); @@ -3554,7 +3552,7 @@ static void fvat_set_empty( const tripoint &pos ) } } -static void fvat_set_full( const tripoint &pos ) +static void fvat_set_full( const tripoint_bub_ms &pos ) { map &here = get_map(); furn_id furn = here.furn( pos ); @@ -3565,7 +3563,7 @@ static void fvat_set_full( const tripoint &pos ) } } -void iexamine::fvat_empty( Character &you, const tripoint &examp ) +void iexamine::fvat_empty( Character &you, const tripoint_bub_ms &examp ) { itype_id brew_type; std::string brew_nname; @@ -3644,7 +3642,7 @@ void iexamine::fvat_empty( Character &you, const tripoint &examp ) break; } case REMOVE_BREW: { - liquid_handler::handle_liquid_from_ground( here.i_at( examp ).begin(), examp ); + liquid_handler::handle_liquid_from_ground( here.i_at( examp ).begin(), examp.raw() ); return; } case START_FERMENT: { @@ -3689,7 +3687,7 @@ void iexamine::fvat_empty( Character &you, const tripoint &examp ) } } -void iexamine::fvat_full( Character &you, const tripoint &examp ) +void iexamine::fvat_full( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); map_stack items_here = here.i_at( examp ); @@ -3767,14 +3765,14 @@ void iexamine::fvat_full( Character &you, const tripoint &examp ) } const std::string booze_name = brew_i.tname(); - if( liquid_handler::handle_liquid_from_ground( items_here.begin(), examp ) ) { + if( liquid_handler::handle_liquid_from_ground( items_here.begin(), examp.raw() ) ) { fvat_set_empty( examp ); add_msg( _( "You squeeze the last drops of %s from the vat." ), booze_name ); } } // Borrowed and modified fermenting vat functions -static void compost_set_empty( const tripoint &pos ) +static void compost_set_empty( const tripoint_bub_ms &pos ) { map &here = get_map(); furn_id furn = here.furn( pos ); @@ -3783,7 +3781,7 @@ static void compost_set_empty( const tripoint &pos ) } } -static void compost_set_full( const tripoint &pos ) +static void compost_set_full( const tripoint_bub_ms &pos ) { map &here = get_map(); furn_id furn = here.furn( pos ); @@ -3792,7 +3790,7 @@ static void compost_set_full( const tripoint &pos ) } } -void iexamine::compost_empty( Character &you, const tripoint &examp ) +void iexamine::compost_empty( Character &you, const tripoint_bub_ms &examp ) { itype_id compost_type; std::string compost_nname; @@ -3871,7 +3869,7 @@ void iexamine::compost_empty( Character &you, const tripoint &examp ) break; } case REMOVE_COMPOST: { - liquid_handler::handle_liquid_from_ground( here.i_at( examp ).begin(), examp ); + liquid_handler::handle_liquid_from_ground( here.i_at( examp ).begin(), examp.raw() ); return; } case START_FERMENT: { @@ -3921,7 +3919,7 @@ void iexamine::compost_empty( Character &you, const tripoint &examp ) } } -void iexamine::compost_full( Character &you, const tripoint &examp ) +void iexamine::compost_full( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); map_stack items_here = here.i_at( examp ); @@ -4048,13 +4046,13 @@ void iexamine::compost_full( Character &you, const tripoint &examp ) } const std::string compost_name = compost_i.tname(); - if( liquid_handler::handle_liquid_from_ground( items_here.begin(), examp ) ) { + if( liquid_handler::handle_liquid_from_ground( items_here.begin(), examp.raw() ) ) { compost_set_empty( examp ); add_msg( _( "You squeeze the last drops of %s from the tank." ), compost_name ); } } -static units::volume get_keg_capacity( const tripoint &pos ) +static units::volume get_keg_capacity( const tripoint_bub_ms &pos ) { const furn_t &furn = get_map().furn( pos ).obj(); return furn.keg_capacity; @@ -4063,12 +4061,12 @@ static units::volume get_keg_capacity( const tripoint &pos ) /** * Check whether there is a keg on the map that can be filled via @ref pour_into_keg. */ -bool iexamine::has_keg( const tripoint &pos ) +bool iexamine::has_keg( const tripoint_bub_ms &pos ) { return get_keg_capacity( pos ) > 0_ml; } -static void displace_items_except_one_liquid( const tripoint &examp ) +static void displace_items_except_one_liquid( const tripoint_bub_ms &examp ) { map &here = get_map(); // Temporarily replace the real furniture with a fake furniture with NOITEM @@ -4094,7 +4092,7 @@ static void displace_items_except_one_liquid( const tripoint &examp ) here.furn_set( examp, previous_furn ); } -void iexamine::keg( Character &you, const tripoint &examp ) +void iexamine::keg( Character &you, const tripoint_bub_ms &examp ) { none( you, examp ); map &here = get_map(); @@ -4210,7 +4208,7 @@ void iexamine::keg( Character &you, const tripoint &examp ) switch( selectmenu.ret ) { case DISPENSE: - if( liquid_handler::handle_liquid_from_ground( items.begin(), examp ) ) { + if( liquid_handler::handle_liquid_from_ground( items.begin(), examp.raw() ) ) { add_msg( _( "You squeeze the last drops of %1$s from the %2$s." ), drink_tname, keg_name ); } @@ -4259,7 +4257,7 @@ void iexamine::keg( Character &you, const tripoint &examp ) * will be removed from the liquid item. * @return Whether any charges have been transferred at all. */ -bool iexamine::pour_into_keg( const tripoint &pos, item &liquid ) +bool iexamine::pour_into_keg( const tripoint_bub_ms &pos, item &liquid ) { const units::volume keg_cap = get_keg_capacity( pos ); if( keg_cap <= 0_ml ) { @@ -4292,7 +4290,7 @@ bool iexamine::pour_into_keg( const tripoint &pos, item &liquid ) return true; } -static void pick_plant( Character &you, const tripoint &examp, +static void pick_plant( Character &you, const tripoint_bub_ms &examp, const itype_id &itemType, ter_id new_ter, bool seeds = false ) { map &here = get_map(); @@ -4323,7 +4321,7 @@ static void pick_plant( Character &you, const tripoint &examp, here.ter_set( examp, new_ter ); } -void iexamine::tree_hickory( Character &you, const tripoint &examp ) +void iexamine::tree_hickory( Character &you, const tripoint_bub_ms &examp ) { bool auto_forage = get_option( "AUTO_FEATURES" ) && ( get_option( "AUTO_FORAGING" ) == "all" || @@ -4365,7 +4363,7 @@ static item_location maple_tree_sap_container() _( "You don't have a container at hand." ) ); } -void iexamine::tree_maple( Character &you, const tripoint &examp ) +void iexamine::tree_maple( Character &you, const tripoint_bub_ms &examp ) { const inventory &crafting_inv = you.crafting_inventory(); if( !crafting_inv.has_quality( qual_DRILL ) ) { @@ -4411,7 +4409,7 @@ void iexamine::tree_maple( Character &you, const tripoint &examp ) } } -void iexamine::tree_maple_tapped( Character &you, const tripoint &examp ) +void iexamine::tree_maple_tapped( Character &you, const tripoint_bub_ms &examp ) { bool has_sap = false; item *container = nullptr; @@ -4516,7 +4514,7 @@ void iexamine::tree_maple_tapped( Character &you, const tripoint &examp ) } } -void iexamine::shrub_marloss( Character &you, const tripoint &examp ) +void iexamine::shrub_marloss( Character &you, const tripoint_bub_ms &examp ) { if( you.has_trait( trait_THRESH_MYCUS ) ) { pick_plant( you, examp, itype_mycus_fruit, ter_t_shrub_fungal ); @@ -4530,7 +4528,7 @@ void iexamine::shrub_marloss( Character &you, const tripoint &examp ) } } -void iexamine::tree_marloss( Character &you, const tripoint &examp ) +void iexamine::tree_marloss( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); if( you.has_trait( trait_THRESH_MYCUS ) ) { @@ -4551,7 +4549,7 @@ void iexamine::tree_marloss( Character &you, const tripoint &examp ) } } -void iexamine::shrub_wildveggies( Character &you, const tripoint &examp ) +void iexamine::shrub_wildveggies( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); // Ask if there's something possibly more interesting than this shrub here @@ -4705,19 +4703,19 @@ void iexamine::part_con( Character &you, tripoint_bub_ms const &examp ) } } -void iexamine::water_source( Character &, const tripoint &examp ) +void iexamine::water_source( Character &, const tripoint_bub_ms &examp ) { map &here = get_map(); item water = here.liquid_from( examp ); - liquid_handler::handle_liquid( water, nullptr, 0, &examp ); + liquid_handler::handle_liquid( water, nullptr, 0, &examp.raw() ); } -void iexamine::finite_water_source( Character &, const tripoint &examp ) +void iexamine::finite_water_source( Character &, const tripoint_bub_ms &examp ) { map_stack items = get_map().i_at( examp ); for( auto item_it = items.begin(); item_it != items.end(); ++item_it ) { if( item_it->made_of( phase_id::LIQUID ) ) { - liquid_handler::handle_liquid_from_ground( item_it, examp ); + liquid_handler::handle_liquid_from_ground( item_it, examp.raw() ); break; } } @@ -4785,7 +4783,7 @@ static int count_charges_in_list( const ammotype *ammotype, const map_stack &ite return 0; } -static void reload_furniture( Character &you, const tripoint &examp, bool allow_unload ) +static void reload_furniture( Character &you, const tripoint_bub_ms &examp, bool allow_unload ) { map &here = get_map(); const furn_t &f = here.furn( examp ).obj(); @@ -4912,12 +4910,12 @@ static void reload_furniture( Character &you, const tripoint &examp, bool allow_ you.invalidate_crafting_inventory(); } -void iexamine::reload_furniture( Character &you, const tripoint &examp ) +void iexamine::reload_furniture( Character &you, const tripoint_bub_ms &examp ) { return reload_furniture( you, examp, true ); } -void iexamine::curtains( Character &you, const tripoint &examp ) +void iexamine::curtains( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const bool closed_window_with_curtains = here.has_flag( @@ -4942,7 +4940,7 @@ void iexamine::curtains( Character &you, const tripoint &examp ) if( choice == 0 ) { // Peek - g->peek( tripoint_bub_ms( examp ) ); + g->peek( examp ); you.add_msg_if_player( _( "You carefully peek through the curtains." ) ); } else if( choice == 1 ) { // Mr. Gorbachev, tear down those curtains! @@ -4961,7 +4959,7 @@ void iexamine::curtains( Character &you, const tripoint &examp ) } } -void iexamine::sign( Character &you, const tripoint &examp ) +void iexamine::sign( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); std::string existing_signage = here.get_signage( examp ); @@ -5236,7 +5234,7 @@ static void turnOnSelectedPump( const tripoint_bub_ms &p, int number, } } -void iexamine::pay_gas( Character &you, const tripoint &examp ) +void iexamine::pay_gas( Character &you, const tripoint_bub_ms &examp ) { int choice = -1; @@ -5251,7 +5249,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) fuel_station_fuel_type fuelType = FUEL_TYPE_NONE; std::string fuelTypeStr; - int pumpCount = getNearPumpCount( tripoint_bub_ms( examp ), fuelType ); + int pumpCount = getNearPumpCount( examp, fuelType ); fuelTypeStr = fuelType == FUEL_TYPE_GASOLINE ? _( "gasoline" ) : fuelType == FUEL_TYPE_DIESEL ? _( "diesel" ) : ""; if( pumpCount == 0 ) { @@ -5260,8 +5258,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) } int tankUnits; - const std::optional pTank_ = getNearFilledGasTank( tripoint_bub_ms( examp ), - tankUnits, fuelType ); + const std::optional pTank_ = getNearFilledGasTank( examp, tankUnits, fuelType ); if( !pTank_ ) { popup( str_to_illiterate_str( string_format( _( "Failure! No %s tank found!" ), fuelTypeStr ) ) ); return; @@ -5321,8 +5318,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) for( int i = 0; i < pumpCount; i++ ) { amenu.addentry( i, true, -1, str_to_illiterate_str( _( "Pump " ) ) + std::to_string( i + 1 ) ); - pumps.emplace_back( getGasPumpByNumber( tripoint_bub_ms( examp ), - i ).value_or( tripoint_bub_ms( examp ) ).raw() ); + pumps.emplace_back( getGasPumpByNumber( examp, i ).value_or( examp ).raw() ); } pointmenu_cb callback( pumps ); amenu.callback = &callback; @@ -5335,7 +5331,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) uistate.ags_pay_gas_selected_pump = choice; - turnOnSelectedPump( tripoint_bub_ms( examp ), uistate.ags_pay_gas_selected_pump, fuelType ); + turnOnSelectedPump( examp, uistate.ags_pay_gas_selected_pump, fuelType ); return; @@ -5367,7 +5363,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) liters = maximum_liters; } - const std::optional pGasPump = getGasPumpByNumber( tripoint_bub_ms( examp ), + const std::optional pGasPump = getGasPumpByNumber( examp, uistate.ags_pay_gas_selected_pump ); if( !pGasPump || !toPumpFuel( pTank, *pGasPump, liters * 1000 ) ) { return; @@ -5386,7 +5382,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) } if( hack == choice ) { - try_start_hacking( you, tripoint_bub_ms( examp ) ); + try_start_hacking( you, examp ); } if( refund == choice ) { @@ -5396,7 +5392,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) return; } - const std::optional pGasPump = getGasPumpByNumber( tripoint_bub_ms( examp ), + const std::optional pGasPump = getGasPumpByNumber( examp, uistate.ags_pay_gas_selected_pump ); int amount_fuel = pGasPump ? fromPumpFuel( pTank, *pGasPump ) : -1; if( amount_fuel < 0 ) { @@ -5430,7 +5426,7 @@ void iexamine::pay_gas( Character &you, const tripoint &examp ) } } -void iexamine::ledge( Character &you, const tripoint &examp ) +void iexamine::ledge( Character &you, const tripoint_bub_ms &examp ) { enum ledge_actions { ledge_peek_down = 1, @@ -5441,11 +5437,11 @@ void iexamine::ledge( Character &you, const tripoint &examp ) }; map &here = get_map(); - tripoint jump_target( you.posx() + 2 * sgn( examp.x - you.posx() ), - you.posy() + 2 * sgn( examp.y - you.posy() ), + tripoint jump_target( you.posx() + 2 * sgn( examp.x() - you.posx() ), + you.posy() + 2 * sgn( examp.y() - you.posy() ), you.posz() ); bool jump_target_valid = ( here.ter( jump_target ).obj().trap != tr_ledge ); - point jd( examp.xy() + point( -you.posx(), -you.posy() ) ); + point jd( examp.xy().raw() + point( -you.posx(), -you.posy() ) ); int jump_direction = 0; if( jd.y > 0 && jd.x == 0 ) { @@ -5466,15 +5462,14 @@ void iexamine::ledge( Character &you, const tripoint &examp ) jump_direction = 7; //southeast } - tripoint just_below = examp; - just_below.z--; + tripoint_bub_ms just_below = examp - tripoint_below; uilist cmenu; cmenu.text = _( "There is a ledge here. What do you want to do?" ); // NOTE this menu is merged with the climb down menu, manage keys carefully. cmenu.addentry( ledge_peek_down, true, 'p', _( "Peek down." ) ); - g->climb_down_menu_gen( examp, cmenu ); + g->climb_down_menu_gen( examp.raw(), cmenu ); if( here.has_flag_furn( "EXAMINE_FROM_ABOVE", just_below ) ) { cmenu.addentry( ledge_examine_furniture_below, true, 'e', _( "Reach for the %s below." ), here.furn( just_below ).obj().name() ); @@ -5491,7 +5486,7 @@ void iexamine::ledge( Character &you, const tripoint &examp ) creature_tracker &creatures = get_creature_tracker(); - if( g->climb_down_menu_pick( examp, cmenu.ret ) ) { + if( g->climb_down_menu_pick( examp.raw(), cmenu.ret ) ) { // This branch means the player chose some option generated by the climb menu. return; } @@ -5507,7 +5502,7 @@ void iexamine::ledge( Character &you, const tripoint &examp ) add_msg( m_warning, _( "You are too weak to jump over an obstacle." ) ); } else if( 100 * you.weight_carried() / you.weight_capacity() > 25 ) { add_msg( m_warning, _( "You are too burdened to jump over an obstacle." ) ); - } else if( !here.valid_move( examp, jump_target, false, true ) ) { + } else if( !here.valid_move( examp.raw(), jump_target, false, true ) ) { add_msg( m_warning, _( "You cannot jump over an obstacle - something is blocking the way." ) ); } else if( creatures.creature_at( jump_target ) ) { add_msg( m_warning, _( "You cannot jump over an obstacle - there is %s blocking the way." ), @@ -5523,22 +5518,21 @@ void iexamine::ledge( Character &you, const tripoint &examp ) } case ledge_peek_down: { // Peek - tripoint where = examp; - tripoint below = examp; - below.z--; + tripoint_bub_ms where = examp; + tripoint_bub_ms below = examp - tripoint_below; while( here.valid_move( where, below, false, true ) ) { - where.z--; - below.z--; + where -= tripoint_below; + below -= tripoint_below; } - const int height = examp.z - where.z; + const int height = examp.z() - where.z(); add_msg_debug( debugmode::DF_IEXAMINE, "Ledge height %d", height ); if( height == 0 ) { you.add_msg_if_player( _( "You can't peek down there." ) ); return; } - g->peek( tripoint_bub_ms( where ) ); + g->peek( where ); you.add_msg_if_player( _( "You peek over the ledge." ) ); break; } @@ -5599,20 +5593,20 @@ void iexamine::ledge( Character &you, const tripoint &examp ) } } -static Character &player_on_couch( Character &you, const tripoint &autodoc_loc, +static Character &player_on_couch( Character &you, const tripoint_bub_ms &autodoc_loc, Character &null_patient, - bool &adjacent_couch, tripoint &couch_pos ) + bool &adjacent_couch, tripoint_bub_ms &couch_pos ) { map &here = get_map(); - for( const tripoint &couch_loc : here.points_in_radius( autodoc_loc, 1 ) ) { + for( const tripoint_bub_ms &couch_loc : here.points_in_radius( autodoc_loc, 1 ) ) { if( here.has_flag_furn( ter_furn_flag::TFLAG_AUTODOC_COUCH, couch_loc ) ) { adjacent_couch = true; couch_pos = couch_loc; - if( you.pos() == couch_loc ) { + if( you.pos_bub() == couch_loc ) { return you; } for( const npc *e : g->allies() ) { - if( e->pos() == couch_loc ) { + if( e->pos_bub() == couch_loc ) { return *g->critter_by_id( e->getID() ); } } @@ -5621,17 +5615,17 @@ static Character &player_on_couch( Character &you, const tripoint &autodoc_loc, return null_patient; } -static Character &operator_present( Character &you, const tripoint &autodoc_loc, +static Character &operator_present( Character &you, const tripoint_bub_ms &autodoc_loc, Character &null_patient ) { map &here = get_map(); - for( const tripoint &loc : here.points_in_radius( autodoc_loc, 1 ) ) { + for( const tripoint_bub_ms &loc : here.points_in_radius( autodoc_loc, 1 ) ) { if( !here.has_flag_furn( ter_furn_flag::TFLAG_AUTODOC_COUCH, loc ) ) { - if( you.pos() == loc ) { + if( you.pos_bub() == loc ) { return you; } for( const npc *e : g->allies() ) { - if( e->pos() == loc ) { + if( e->pos_bub() == loc ) { return *g->critter_by_id( e->getID() ); } } @@ -5640,7 +5634,7 @@ static Character &operator_present( Character &you, const tripoint &autodoc_loc, return null_patient; } -static item &cyborg_on_couch( const tripoint &couch_pos, item &null_cyborg ) +static item &cyborg_on_couch( const tripoint_bub_ms &couch_pos, item &null_cyborg ) { for( item &it : get_map().i_at( couch_pos ) ) { if( it.typeId() == itype_bot_broken_cyborg || it.typeId() == itype_bot_prototype_cyborg ) { @@ -5711,7 +5705,7 @@ inline void popup_player_or_npc( Character &you, const char *player_mes, const c } } -void iexamine::autodoc( Character &you, const tripoint &examp ) +void iexamine::autodoc( Character &you, const tripoint_bub_ms &examp ) { enum options { INSTALL_CBM, @@ -5724,7 +5718,7 @@ void iexamine::autodoc( Character &you, const tripoint &examp ) bool adjacent_couch = false; static avatar null_player; - tripoint couch_pos; + tripoint_bub_ms couch_pos; Character &patient = player_on_couch( you, examp, null_player, adjacent_couch, couch_pos ); Character &Operator = operator_present( you, examp, null_player ); @@ -5765,7 +5759,7 @@ void iexamine::autodoc( Character &you, const tripoint &examp ) } int choice_index = uilist( _( "Choose bionic to uninstall" ), choice_names ); if( choice_index == 0 ) { - g->save_cyborg( &cyborg, couch_pos, you ); + g->save_cyborg( &cyborg, couch_pos.raw(), you ); } else { popup( _( "UNKNOWN COMMAND. Autodoc Mk. XI. Crashed." ) ); return; @@ -6125,7 +6119,7 @@ static bool is_non_rotten_crafting_component( const item &it ) return is_crafting_component( it ) && !it.rotten(); } -static void mill_activate( Character &you, const tripoint &examp ) +static void mill_activate( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const furn_id cur_mill_type = here.furn( examp ); @@ -6280,7 +6274,7 @@ static void mill_activate( Character &you, const tripoint &examp ) for( item &it : here.i_at( examp ) ) { if( it.type->milling_data && !it.type->milling_data->into_.is_null() ) { // Do one final rot check before milling, then apply the PROCESSING flag to prevent further checks. - it.process_temperature_rot( 1, examp, get_map(), nullptr ); + it.process_temperature_rot( 1, examp.raw(), get_map(), nullptr ); it.set_flag( flag_PROCESSING ); } } @@ -6292,7 +6286,7 @@ static void mill_activate( Character &you, const tripoint &examp ) add_msg( _( "You remove the brake on the millstone and it slowly starts to turn." ) ); } -static void smoker_activate( Character &you, const tripoint &examp ) +static void smoker_activate( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); furn_id cur_smoker_type = here.furn( examp ); @@ -6381,7 +6375,7 @@ static void smoker_activate( Character &you, const tripoint &examp ) you.use_charges( itype_fire, 1 ); for( item &it : here.i_at( examp ) ) { if( it.has_flag( flag_SMOKABLE ) ) { - it.process_temperature_rot( 1, examp, get_map(), nullptr ); + it.process_temperature_rot( 1, examp.raw(), get_map(), nullptr ); it.set_flag( flag_PROCESSING ); } } @@ -6581,7 +6575,7 @@ static void smoker_finalize( Character &, const tripoint &examp, const time_poin here.furn_set( examp, next_smoker_type ); } -static void smoker_load_food( Character &you, const tripoint &examp, +static void smoker_load_food( Character &you, const tripoint_bub_ms &examp, const units::volume &remaining_capacity ) { map &here = get_map(); @@ -6627,7 +6621,7 @@ static void smoker_load_food( Character &you, const tripoint &examp, } } -static void mill_load_food( Character &you, const tripoint &examp, +static void mill_load_food( Character &you, const tripoint_bub_ms &examp, const units::volume &remaining_capacity ) { std::vector comps; @@ -6773,7 +6767,7 @@ void iexamine::on_smoke_out( const tripoint &examp, const time_point &start_time } } -void iexamine::quern_examine( Character &you, const tripoint &examp ) +void iexamine::quern_examine( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); if( here.furn( examp ) == furn_f_water_mill ) { @@ -6948,7 +6942,7 @@ void iexamine::quern_examine( Character &you, const tripoint &examp ) } } -void iexamine::smoker_options( Character &you, const tripoint &examp ) +void iexamine::smoker_options( Character &you, const tripoint_bub_ms &examp ) { map &here = get_map(); const bool active = here.furn( examp ) == furn_f_smoking_rack_active || @@ -7177,13 +7171,13 @@ void iexamine::smoker_options( Character &you, const tripoint &examp ) } } -void iexamine::open_safe( Character &, const tripoint &examp ) +void iexamine::open_safe( Character &, const tripoint_bub_ms &examp ) { add_msg( m_info, _( "You open the unlocked safe." ) ); get_map().furn_set( examp, furn_f_safe_o ); } -void iexamine::workbench( Character &you, const tripoint &examp ) +void iexamine::workbench( Character &you, const tripoint_bub_ms &examp ) { if( get_option( "WORKBENCH_ALL_OPTIONS" ) ) { workbench_internal( you, examp, std::nullopt ); @@ -7197,7 +7191,7 @@ void iexamine::workbench( Character &you, const tripoint &examp ) } } -void iexamine::workbench_internal( Character &you, const tripoint &examp, +void iexamine::workbench_internal( Character &you, const tripoint_bub_ms &examp, const std::optional &part ) { std::vector crafts; @@ -7264,7 +7258,7 @@ void iexamine::workbench_internal( Character &you, const tripoint &examp, } else if( you.has_effect( effect_incorporeal ) ) { add_msg( m_info, _( "You lack the substance to affect anything." ) ); } else { - you.craft( examp ); + you.craft( examp.raw() ); } break; } @@ -7274,7 +7268,7 @@ void iexamine::workbench_internal( Character &you, const tripoint &examp, } else if( you.has_effect( effect_incorporeal ) ) { add_msg( m_info, _( "You lack the substance to affect anything." ) ); } else { - you.recraft( examp ); + you.recraft( examp.raw() ); } break; } @@ -7284,7 +7278,7 @@ void iexamine::workbench_internal( Character &you, const tripoint &examp, } else if( you.has_effect( effect_incorporeal ) ) { add_msg( m_info, _( "You lack the substance to affect anything." ) ); } else { - you.long_craft( examp ); + you.long_craft( examp.raw() ); } break; } @@ -7340,7 +7334,7 @@ void iexamine::workbench_internal( Character &you, const tripoint &examp, } } -void iexamine::workout( Character &you, const tripoint &examp ) +void iexamine::workout( Character &you, const tripoint_bub_ms &examp ) { if( !query_yn( _( "Use the %s to exercise?" ), get_map().furnname( examp ) ) ) { none( you, examp ); @@ -7349,7 +7343,7 @@ void iexamine::workout( Character &you, const tripoint &examp ) you.assign_activity( workout_activity_actor( examp ) ); } -void iexamine::invalid( Character &/*you*/, const tripoint &examp ) +void iexamine::invalid( Character &/*you*/, const tripoint_bub_ms &examp ) { debugmsg( "Called invalid iexamine function on %s!", get_map().tername( examp ) ); } diff --git a/src/iexamine.h b/src/iexamine.h index 022b6c9ac6176..be6c74e41770a 100644 --- a/src/iexamine.h +++ b/src/iexamine.h @@ -30,7 +30,7 @@ struct iexamine_actor { explicit iexamine_actor( const std::string &type ) : type( type ) {} virtual void load( const JsonObject &, const std::string & ) = 0; - virtual void call( Character &, const tripoint & ) const = 0; + virtual void call( Character &, const tripoint_bub_ms & ) const = 0; virtual void finalize() const = 0; virtual std::unique_ptr clone() const = 0; @@ -53,108 +53,108 @@ bool try_start_hacking( Character &you, const tripoint_bub_ms &examp ); void egg_sack_generic( Character &you, const tripoint &examp, const mtype_id &montype ); -void none( Character &you, const tripoint &examp ); +void none( Character &you, const tripoint_bub_ms &examp ); -bool always_false( const tripoint &examp ); -bool false_and_debugmsg( const tripoint &examp ); -bool always_true( const tripoint &examp ); -bool harvestable_now( const tripoint &examp ); +bool always_false( const tripoint_bub_ms &examp ); +bool false_and_debugmsg( const tripoint_bub_ms &examp ); +bool always_true( const tripoint_bub_ms &examp ); +bool harvestable_now( const tripoint_bub_ms &examp ); -void gaspump( Character &you, const tripoint &examp ); -void atm( Character &you, const tripoint &examp ); -void vending( Character &you, const tripoint &examp ); -void elevator( Character &you, const tripoint &examp ); -void nanofab( Character &you, const tripoint &examp ); -void controls_gate( Character &you, const tripoint &examp ); +void gaspump( Character &you, const tripoint_bub_ms &examp ); +void atm( Character &you, const tripoint_bub_ms &examp ); +void vending( Character &you, const tripoint_bub_ms &examp ); +void elevator( Character &you, const tripoint_bub_ms &examp ); +void nanofab( Character &you, const tripoint_bub_ms &examp ); +void controls_gate( Character &you, const tripoint_bub_ms &examp ); void cardreader( Character &you, const tripoint &examp ); -void cardreader_robofac( Character &you, const tripoint &examp ); -void cardreader_foodplace( Character &you, const tripoint &examp ); -void intercom( Character &you, const tripoint &examp ); -void cvdmachine( Character &you, const tripoint &examp ); -void change_appearance( Character &you, const tripoint &examp ); -void rubble( Character &you, const tripoint &examp ); -void chainfence( Character &you, const tripoint &examp ); -void bars( Character &you, const tripoint &examp ); -void deployed_furniture( Character &you, const tripoint &pos ); -void portable_structure( Character &you, const tripoint &examp ); -void pit( Character &you, const tripoint &examp ); -void pit_covered( Character &you, const tripoint &examp ); -void safe( Character &you, const tripoint &examp ); -void gunsafe_el( Character &you, const tripoint &examp ); -void harvest_furn_nectar( Character &you, const tripoint &examp ); -void harvest_furn( Character &you, const tripoint &examp ); -void harvest_ter_nectar( Character &you, const tripoint &examp ); -void harvest_ter( Character &you, const tripoint &examp ); -void harvested_plant( Character &you, const tripoint &examp ); -void locked_object( Character &you, const tripoint &examp ); -void locked_object_pickable( Character &you, const tripoint &examp ); -void bulletin_board( Character &you, const tripoint &examp ); -void pedestal_wyrm( Character &you, const tripoint &examp ); -void pedestal_temple( Character &you, const tripoint &examp ); -void door_peephole( Character &you, const tripoint &examp ); -void fswitch( Character &you, const tripoint &examp ); +void cardreader_robofac( Character &you, const tripoint_bub_ms &examp ); +void cardreader_foodplace( Character &you, const tripoint_bub_ms &examp ); +void intercom( Character &you, const tripoint_bub_ms &examp ); +void cvdmachine( Character &you, const tripoint_bub_ms &examp ); +void change_appearance( Character &you, const tripoint_bub_ms &examp ); +void rubble( Character &you, const tripoint_bub_ms &examp ); +void chainfence( Character &you, const tripoint_bub_ms &examp ); +void bars( Character &you, const tripoint_bub_ms &examp ); +void deployed_furniture( Character &you, const tripoint_bub_ms &pos ); +void portable_structure( Character &you, const tripoint_bub_ms &examp ); +void pit( Character &you, const tripoint_bub_ms &examp ); +void pit_covered( Character &you, const tripoint_bub_ms &examp ); +void safe( Character &you, const tripoint_bub_ms &examp ); +void gunsafe_el( Character &you, const tripoint_bub_ms &examp ); +void harvest_furn_nectar( Character &you, const tripoint_bub_ms &examp ); +void harvest_furn( Character &you, const tripoint_bub_ms &examp ); +void harvest_ter_nectar( Character &you, const tripoint_bub_ms &examp ); +void harvest_ter( Character &you, const tripoint_bub_ms &examp ); +void harvested_plant( Character &you, const tripoint_bub_ms &examp ); +void locked_object( Character &you, const tripoint_bub_ms &examp ); +void locked_object_pickable( Character &you, const tripoint_bub_ms &examp ); +void bulletin_board( Character &you, const tripoint_bub_ms &examp ); +void pedestal_wyrm( Character &you, const tripoint_bub_ms &examp ); +void pedestal_temple( Character &you, const tripoint_bub_ms &examp ); +void door_peephole( Character &you, const tripoint_bub_ms &examp ); +void fswitch( Character &you, const tripoint_bub_ms &examp ); void flower_tulip( Character &you, const tripoint &examp ); void flower_spurge( Character &you, const tripoint &examp ); -void flower_poppy( Character &you, const tripoint &examp ); -void flower_cactus( Character &you, const tripoint &examp ); +void flower_poppy( Character &you, const tripoint_bub_ms &examp ); +void flower_cactus( Character &you, const tripoint_bub_ms &examp ); void flower_bluebell( Character &you, const tripoint &examp ); -void flower_dahlia( Character &you, const tripoint &examp ); -void flower_marloss( Character &you, const tripoint &examp ); -void fungus( Character &you, const tripoint &examp ); -void dirtmound( Character &you, const tripoint &examp ); -void aggie_plant( Character &you, const tripoint &examp ); -void tree_hickory( Character &you, const tripoint &examp ); -void tree_maple( Character &you, const tripoint &examp ); -void tree_maple_tapped( Character &you, const tripoint &examp ); -void shrub_marloss( Character &you, const tripoint &examp ); -void tree_marloss( Character &you, const tripoint &examp ); -void shrub_wildveggies( Character &you, const tripoint &examp ); +void flower_dahlia( Character &you, const tripoint_bub_ms &examp ); +void flower_marloss( Character &you, const tripoint_bub_ms &examp ); +void fungus( Character &you, const tripoint_bub_ms &examp ); +void dirtmound( Character &you, const tripoint_bub_ms &examp ); +void aggie_plant( Character &you, const tripoint_bub_ms &examp ); +void tree_hickory( Character &you, const tripoint_bub_ms &examp ); +void tree_maple( Character &you, const tripoint_bub_ms &examp ); +void tree_maple_tapped( Character &you, const tripoint_bub_ms &examp ); +void shrub_marloss( Character &you, const tripoint_bub_ms &examp ); +void tree_marloss( Character &you, const tripoint_bub_ms &examp ); +void shrub_wildveggies( Character &you, const tripoint_bub_ms &examp ); // TODO: Get rid of untyped overload. void part_con( Character &you, const tripoint &examp ); void part_con( Character &you, const tripoint_bub_ms &examp ); -void water_source( Character &, const tripoint &examp ); -void finite_water_source( Character &, const tripoint &examp ); -void kiln_empty( Character &you, const tripoint &examp ); -void kiln_full( Character &you, const tripoint &examp ); -void stook_empty( Character &, const tripoint &examp ); -void stook_full( Character &, const tripoint &examp ); -void arcfurnace_empty( Character &you, const tripoint &examp ); -void arcfurnace_full( Character &you, const tripoint &examp ); -void autoclave_empty( Character &you, const tripoint &examp ); -void autoclave_full( Character &, const tripoint &examp ); -void fireplace( Character &you, const tripoint &examp ); -void fvat_empty( Character &you, const tripoint &examp ); -void fvat_full( Character &you, const tripoint &examp ); -void compost_empty( Character &you, const tripoint &examp ); -void compost_full( Character &you, const tripoint &examp ); -void keg( Character &you, const tripoint &examp ); -void reload_furniture( Character &you, const tripoint &examp ); -void curtains( Character &you, const tripoint &examp ); -void sign( Character &you, const tripoint &examp ); -void pay_gas( Character &you, const tripoint &examp ); -void ledge( Character &you, const tripoint &examp ); -void autodoc( Character &you, const tripoint &examp ); -void attunement_altar( Character &you, const tripoint &examp ); -void translocator( Character &you, const tripoint &examp ); +void water_source( Character &, const tripoint_bub_ms &examp ); +void finite_water_source( Character &, const tripoint_bub_ms &examp ); +void kiln_empty( Character &you, const tripoint_bub_ms &examp ); +void kiln_full( Character &you, const tripoint_bub_ms &examp ); +void stook_empty( Character &, const tripoint_bub_ms &examp ); +void stook_full( Character &, const tripoint_bub_ms &examp ); +void arcfurnace_empty( Character &you, const tripoint_bub_ms &examp ); +void arcfurnace_full( Character &you, const tripoint_bub_ms &examp ); +void autoclave_empty( Character &you, const tripoint_bub_ms &examp ); +void autoclave_full( Character &, const tripoint_bub_ms &examp ); +void fireplace( Character &you, const tripoint_bub_ms &examp ); +void fvat_empty( Character &you, const tripoint_bub_ms &examp ); +void fvat_full( Character &you, const tripoint_bub_ms &examp ); +void compost_empty( Character &you, const tripoint_bub_ms &examp ); +void compost_full( Character &you, const tripoint_bub_ms &examp ); +void keg( Character &you, const tripoint_bub_ms &examp ); +void reload_furniture( Character &you, const tripoint_bub_ms &examp ); +void curtains( Character &you, const tripoint_bub_ms &examp ); +void sign( Character &you, const tripoint_bub_ms &examp ); +void pay_gas( Character &you, const tripoint_bub_ms &examp ); +void ledge( Character &you, const tripoint_bub_ms &examp ); +void autodoc( Character &you, const tripoint_bub_ms &examp ); +void attunement_altar( Character &you, const tripoint_bub_ms &examp ); +void translocator( Character &you, const tripoint_bub_ms &examp ); void on_smoke_out( const tripoint &examp, const time_point &start_time ); //activates end of smoking effects void mill_finalize( Character &, const tripoint &examp ); -void quern_examine( Character &you, const tripoint &examp ); -void smoker_options( Character &you, const tripoint &examp ); -void open_safe( Character &you, const tripoint &examp ); -void workbench( Character &you, const tripoint &examp ); -void workbench_internal( Character &you, const tripoint &examp, +void quern_examine( Character &you, const tripoint_bub_ms &examp ); +void smoker_options( Character &you, const tripoint_bub_ms &examp ); +void open_safe( Character &you, const tripoint_bub_ms &examp ); +void workbench( Character &you, const tripoint_bub_ms &examp ); +void workbench_internal( Character &you, const tripoint_bub_ms &examp, const std::optional &part ); -void workout( Character &you, const tripoint &examp ); -void invalid( Character &you, const tripoint &examp ); +void workout( Character &you, const tripoint_bub_ms &examp ); +void invalid( Character &you, const tripoint_bub_ms &examp ); -bool pour_into_keg( const tripoint &pos, item &liquid ); +bool pour_into_keg( const tripoint_bub_ms &pos, item &liquid ); std::optional getGasPumpByNumber( const tripoint_bub_ms &p, int number ); bool toPumpFuel( const tripoint_bub_ms &src, const tripoint_bub_ms &dst, int units ); std::optional getNearFilledGasTank( const tripoint_bub_ms ¢er, int &fuel_units, fuel_station_fuel_type &fuel_type ); -bool has_keg( const tripoint &pos ); +bool has_keg( const tripoint_bub_ms &pos ); std::list get_harvest_items( const itype &type, int plant_count, int seed_count, bool byproducts ); @@ -162,13 +162,14 @@ std::list get_harvest_items( const itype &type, int plant_count, // Planting functions std::vector get_seed_entries( const std::vector &seed_inv ); int query_seed( const std::vector &seed_entries ); -void plant_seed( Character &you, const tripoint &examp, const itype_id &seed_id ); -void clear_overgrown( Character &you, const tripoint &examp ); -void harvest_plant_ex( Character &you, const tripoint &examp ); -void harvest_plant( Character &you, const tripoint &examp, bool from_activity ); -void fertilize_plant( Character &you, const tripoint &tile, const itype_id &fertilizer ); +void plant_seed( Character &you, const tripoint_bub_ms &examp, const itype_id &seed_id ); +void clear_overgrown( Character &you, const tripoint_bub_ms &examp ); +void harvest_plant_ex( Character &you, const tripoint_bub_ms &examp ); +void harvest_plant( Character &you, const tripoint_bub_ms &examp, bool from_activity ); +void fertilize_plant( Character &you, const tripoint_bub_ms &tile, const itype_id &fertilizer ); itype_id choose_fertilizer( Character &you, const std::string &pname, bool ask_player ); -ret_val can_fertilize( Character &you, const tripoint &tile, const itype_id &fertilizer ); +ret_val can_fertilize( Character &you, const tripoint_bub_ms &tile, + const itype_id &fertilizer ); // Skill training common functions void practice_survival_while_foraging( Character &who ); @@ -181,8 +182,8 @@ bool drink_nectar( Character &you ); void handle_harvest( Character &you, const std::string &itemid, bool force_drop ); } // namespace iexamine_helper -using iexamine_examine_function = void ( * )( Character &, const tripoint & ); -using iexamine_can_examine_function = bool ( * )( const tripoint & ); +using iexamine_examine_function = void ( * )( Character &, const tripoint_bub_ms & ); +using iexamine_can_examine_function = bool ( * )( const tripoint_bub_ms & ); struct iexamine_functions { iexamine_can_examine_function can_examine; iexamine_examine_function examine; diff --git a/src/iexamine_actors.cpp b/src/iexamine_actors.cpp index 973f7d1a46e88..14ce62936e0d3 100644 --- a/src/iexamine_actors.cpp +++ b/src/iexamine_actors.cpp @@ -24,7 +24,7 @@ void appliance_convert_examine_actor::load( const JsonObject &jo, const std::str mandatory( jo, false, "item", appliance_item ); } -void appliance_convert_examine_actor::call( Character &, const tripoint &examp ) const +void appliance_convert_examine_actor::call( Character &, const tripoint_bub_ms &examp ) const { if( !query_yn( _( "Connect %s to grid?" ), item::nname( appliance_item ) ) ) { return; @@ -37,7 +37,7 @@ void appliance_convert_examine_actor::call( Character &, const tripoint &examp ) here.ter_set( examp, *ter_set ); } - place_appliance( examp, vpart_appliance_from_item( appliance_item ) ); + place_appliance( examp.raw(), vpart_appliance_from_item( appliance_item ) ); } void appliance_convert_examine_actor::finalize() const @@ -95,7 +95,7 @@ void cardreader_examine_actor::consume_card( const std::vector &c } std::vector cardreader_examine_actor::get_cards( Character &you, - const tripoint &examp )const + const tripoint_bub_ms &examp )const { std::vector ret; @@ -125,7 +125,7 @@ std::vector cardreader_examine_actor::get_cards( Character &you, return ret; } -bool cardreader_examine_actor::apply( const tripoint &examp ) const +bool cardreader_examine_actor::apply( const tripoint_bub_ms &examp ) const { bool open = true; @@ -139,12 +139,12 @@ bool cardreader_examine_actor::apply( const tripoint &examp ) const has_colliding_vehicle.str() ); } set_queued_points(); - here.set_seen_cache_dirty( tripoint_bub_ms( examp ) ); - here.set_transparency_cache_dirty( examp.z ); + here.set_seen_cache_dirty( examp ); + here.set_transparency_cache_dirty( examp.z() ); } else { open = false; - const tripoint_range points = here.points_in_radius( examp, radius ); - for( const tripoint &tmp : points ) { + const tripoint_range points = here.points_in_radius( examp, radius ); + for( const tripoint_bub_ms &tmp : points ) { const auto ter_iter = terrain_changes.find( here.ter( tmp ).id() ); const auto furn_iter = furn_changes.find( here.furn( tmp ).id() ); if( ter_iter != terrain_changes.end() ) { @@ -164,7 +164,7 @@ bool cardreader_examine_actor::apply( const tripoint &examp ) const /** * Use id/hack reader. Using an id despawns turrets. */ -void cardreader_examine_actor::call( Character &you, const tripoint &examp ) const +void cardreader_examine_actor::call( Character &you, const tripoint_bub_ms &examp ) const { bool open = false; map &here = get_map(); @@ -251,7 +251,7 @@ std::unique_ptr cardreader_examine_actor::clone() const return std::make_unique( *this ); } -void eoc_examine_actor::call( Character &you, const tripoint &examp ) const +void eoc_examine_actor::call( Character &you, const tripoint_bub_ms &examp ) const { dialogue d( get_talker_for( you ), nullptr ); d.set_value( "npctalk_var_this", get_map().furn( examp ).id().str() ); diff --git a/src/iexamine_actors.h b/src/iexamine_actors.h index 2cfa9990dc7d8..c50aa93f693cb 100644 --- a/src/iexamine_actors.h +++ b/src/iexamine_actors.h @@ -21,7 +21,7 @@ class appliance_convert_examine_actor : public iexamine_actor : iexamine_actor( type ) {} void load( const JsonObject &jo, const std::string & ) override; - void call( Character &you, const tripoint &examp ) const override; + void call( Character &you, const tripoint_bub_ms &examp ) const override; void finalize() const override; std::unique_ptr clone() const override; @@ -53,15 +53,15 @@ class cardreader_examine_actor : public iexamine_actor std::string redundant_msg; void consume_card( const std::vector &cards ) const; - std::vector get_cards( Character &you, const tripoint &examp ) const; - bool apply( const tripoint &examp ) const; + std::vector get_cards( Character &you, const tripoint_bub_ms &examp ) const; + bool apply( const tripoint_bub_ms &examp ) const; public: explicit cardreader_examine_actor( const std::string &type = "cardreader" ) : iexamine_actor( type ) {} void load( const JsonObject &jo, const std::string & ) override; - void call( Character &you, const tripoint &examp ) const override; + void call( Character &you, const tripoint_bub_ms &examp ) const override; void finalize() const override; std::unique_ptr clone() const override; @@ -76,7 +76,7 @@ class eoc_examine_actor : public iexamine_actor : iexamine_actor( type ) {} void load( const JsonObject &jo, const std::string &src ) override; - void call( Character &you, const tripoint &examp ) const override; + void call( Character &you, const tripoint_bub_ms &examp ) const override; void finalize() const override; std::unique_ptr clone() const override; diff --git a/src/iuse_actor.cpp b/src/iuse_actor.cpp index 914bab4e519ad..22d35e227bf5f 100644 --- a/src/iuse_actor.cpp +++ b/src/iuse_actor.cpp @@ -5216,10 +5216,10 @@ std::optional deploy_tent_actor::use( Character *p, item &it, const tripoin return 0; } -bool deploy_tent_actor::check_intact( const tripoint ¢er ) const +bool deploy_tent_actor::check_intact( const tripoint_bub_ms ¢er ) const { map &here = get_map(); - for( const tripoint &dest : here.points_in_radius( center, radius ) ) { + for( const tripoint_bub_ms &dest : here.points_in_radius( center, radius ) ) { const furn_id fid = here.furn( dest ); if( dest == center && floor_center ) { if( fid != *floor_center ) { diff --git a/src/iuse_actor.h b/src/iuse_actor.h index 79eac39c44092..c42b1ba9b33ce 100644 --- a/src/iuse_actor.h +++ b/src/iuse_actor.h @@ -1123,7 +1123,7 @@ class deploy_tent_actor : public iuse_actor std::optional use( Character *, item &, const tripoint & ) const override; std::unique_ptr clone() const override; - bool check_intact( const tripoint ¢er ) const; + bool check_intact( const tripoint_bub_ms ¢er ) const; }; /** diff --git a/src/magic_teleporter_list.cpp b/src/magic_teleporter_list.cpp index 6153ddadd4b34..f4ac0af1d918c 100644 --- a/src/magic_teleporter_list.cpp +++ b/src/magic_teleporter_list.cpp @@ -47,7 +47,7 @@ static bool popup_string( std::string &result, std::string &title ) return true; } -bool teleporter_list::activate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint & ) +bool teleporter_list::activate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint_bub_ms & ) { std::string point_name; std::string title = _( "Name this gate." ); @@ -55,7 +55,8 @@ bool teleporter_list::activate_teleporter( const tripoint_abs_omt &omt_pt, const return known_teleporters.emplace( omt_pt, point_name ).second; } -void teleporter_list::deactivate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint & ) +void teleporter_list::deactivate_teleporter( const tripoint_abs_omt &omt_pt, + const tripoint_bub_ms & ) { known_teleporters.erase( omt_pt ); } @@ -113,7 +114,7 @@ void teleporter_list::translocate( const std::set &targets ) valid_targets = true; if( !place_avatar_overmap( *you, *omt_dest ) ) { add_msg( _( "Failed to teleport. Teleporter obstructed or destroyed." ) ); - deactivate_teleporter( *omt_dest, pt.raw() ); + deactivate_teleporter( *omt_dest, pt ); } } } diff --git a/src/magic_teleporter_list.h b/src/magic_teleporter_list.h index 9d4d6ff687a46..5470b2caff314 100644 --- a/src/magic_teleporter_list.h +++ b/src/magic_teleporter_list.h @@ -28,8 +28,8 @@ class teleporter_list public: bool knows_translocator( const tripoint_abs_omt &omt_pos ) const; // adds teleporter to known_teleporters and does any other activation necessary - bool activate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint &local_pt ); - void deactivate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint &local_pt ); + bool activate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint_bub_ms &local_pt ); + void deactivate_teleporter( const tripoint_abs_omt &omt_pt, const tripoint_bub_ms &local_pt ); // calls the necessary functions to select translocator location // and teleports the target(s) there diff --git a/src/mapdata.cpp b/src/mapdata.cpp index 5ea21968363ec..473f0962e13c6 100644 --- a/src/mapdata.cpp +++ b/src/mapdata.cpp @@ -571,14 +571,9 @@ std::string map_data_common_t::name() const return name_.translated(); } -bool map_data_common_t::can_examine( const tripoint &examp ) const -{ - return examine_actor || examine_func.can_examine( examp ); -} - bool map_data_common_t::can_examine( const tripoint_bub_ms &examp ) const { - return map_data_common_t::can_examine( examp.raw() ); + return examine_actor || examine_func.can_examine( examp ); } bool map_data_common_t::has_examine( iexamine_examine_function func ) const @@ -596,7 +591,7 @@ void map_data_common_t::set_examine( iexamine_functions func ) examine_func = func; } -void map_data_common_t::examine( Character &you, const tripoint &examp ) const +void map_data_common_t::examine( Character &you, const tripoint_bub_ms &examp ) const { if( !examine_actor ) { examine_func.examine( you, examp ); @@ -605,11 +600,6 @@ void map_data_common_t::examine( Character &you, const tripoint &examp ) const examine_actor->call( you, examp ); } -void map_data_common_t::examine( Character &you, const tripoint_bub_ms &examp ) const -{ - map_data_common_t::examine( you, examp.raw() ); -} - void map_data_common_t::load_symbol( const JsonObject &jo, const std::string &context ) { if( jo.has_member( "copy-from" ) && looks_like.empty() ) { diff --git a/src/mapdata.h b/src/mapdata.h index f7df191e90167..d3500d7fba1d0 100644 --- a/src/mapdata.h +++ b/src/mapdata.h @@ -492,14 +492,10 @@ struct map_data_common_t { */ std::array symbol_; - // TODO: Get rid of untyped overload. - bool can_examine( const tripoint &examp ) const; bool can_examine( const tripoint_bub_ms &examp ) const; bool has_examine( iexamine_examine_function func ) const; bool has_examine( const std::string &action ) const; void set_examine( iexamine_functions func ); - // TODO: Get rid of untyped overload. - void examine( Character &, const tripoint & ) const; void examine( Character &, const tripoint_bub_ms & ) const; int light_emitted = 0; diff --git a/src/vehicle_use.cpp b/src/vehicle_use.cpp index 582a881aa2bf0..8390cd848bc13 100644 --- a/src/vehicle_use.cpp +++ b/src/vehicle_use.cpp @@ -1832,7 +1832,7 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ return; } const vpart_position vp = *ovp; - const tripoint vppos = vp.pos(); + const tripoint_bub_ms vppos = vp.pos_bub(); std::vector vp_parts = get_parts_at( vppos, "", part_status_flag::working ); @@ -2027,7 +2027,7 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ .hotkey( "UNLOAD_TURRET" ) .skip_locked_check() .on_submit( [this, vppos] { - item_location loc = turret_query( vppos ).base(); + item_location loc = turret_query( vppos.raw() ).base(); get_player_character().unload( loc ); } ); } @@ -2037,7 +2037,7 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ .hotkey( "RELOAD_TURRET" ) .skip_locked_check() .on_submit( [this, vppos] { - item_location loc = turret_query( vppos ).base(); + item_location loc = turret_query( vppos.raw() ).base(); item::reload_option opt = get_player_character().select_ammo( loc, true ); if( opt ) { @@ -2301,7 +2301,7 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ const size_t mc_idx = vp_monster_capture->part_index(); menu.add( _( "Capture or release a creature" ) ) .hotkey( "USE_CAPTURE_MONSTER_VEH" ) - .on_submit( [this, mc_idx, vppos] { use_monster_capture( mc_idx, vppos ); } ); + .on_submit( [this, mc_idx, vppos] { use_monster_capture( mc_idx, vppos.raw() ); } ); } const std::optional vp_bike_rack = vp.avail_part_with_feature( "BIKE_RACK_VEH" ); @@ -2314,13 +2314,13 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ const size_t hn_idx = vp_harness->part_index(); menu.add( _( "Harness an animal" ) ) .hotkey( "USE_ANIMAL_CTRL" ) - .on_submit( [this, hn_idx, vppos] { use_harness( hn_idx, vppos ); } ); + .on_submit( [this, hn_idx, vppos] { use_harness( hn_idx, vppos.raw() ); } ); } if( vp.avail_part_with_feature( "PLANTER" ) ) { menu.add( _( "Reload seed drill with seeds" ) ) .hotkey( "USE_PLANTER" ) - .on_submit( [this, vppos] { reload_seeds( vppos ); } ); + .on_submit( [this, vppos] { reload_seeds( vppos.raw() ); } ); } const std::optional vp_workbench = vp.avail_part_with_feature( "WORKBENCH" ); @@ -2430,7 +2430,7 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ menu.add( string_format( _( "Check the lock on %s" ), vp_lockable_door->part().name() ) ) .hotkey( "LOCKPICK" ) .on_submit( [p] { - iexamine::locked_object( get_player_character(), p ); + iexamine::locked_object( get_player_character(), tripoint_bub_ms( p ) ); } ); } } diff --git a/tests/eoc_test.cpp b/tests/eoc_test.cpp index d46243fd356ec..ea3fb72c1032e 100644 --- a/tests/eoc_test.cpp +++ b/tests/eoc_test.cpp @@ -1307,7 +1307,7 @@ TEST_CASE( "EOC_map_test", "[eoc]" ) map &m = get_map(); const tripoint_abs_ms start = get_avatar().get_location(); - const tripoint tgt = m.getlocal( start + tripoint_north ); + const tripoint_bub_ms tgt = m.bub_from_abs( start + tripoint_north ); m.furn_set( tgt, furn_test_f_eoc ); m.furn( tgt )->examine( get_avatar(), tgt ); @@ -1334,7 +1334,7 @@ TEST_CASE( "EOC_loc_relative_test", "[eoc]" ) g->place_player( tripoint_zero ); const tripoint_abs_ms start = get_avatar().get_location(); - const tripoint tgt = m.getlocal( start + tripoint_north ); + const tripoint_bub_ms tgt = m.bub_from_abs( start + tripoint_north ); m.furn_set( tgt, furn_test_f_eoc ); m.furn( tgt )->examine( get_avatar(), tgt ); diff --git a/tests/iexamine_test.cpp b/tests/iexamine_test.cpp index 2193151eb0edb..77ca3d7e520ce 100644 --- a/tests/iexamine_test.cpp +++ b/tests/iexamine_test.cpp @@ -24,8 +24,8 @@ TEST_CASE( "examine_bush" ) { clear_map(); map &m = get_map(); - const tripoint &pine_loc = tripoint_zero; - const tripoint &elderberry_loc = tripoint_east; + const tripoint_bub_ms &pine_loc = tripoint_bub_ms_zero; + const tripoint_bub_ms &elderberry_loc = pine_loc + tripoint_east; m.ter_set( pine_loc, ter_id( "t_tree_pine" ) ); m.ter_set( elderberry_loc, ter_id( "t_tree_elderberry" ) ); diff --git a/tests/player_activities_test.cpp b/tests/player_activities_test.cpp index a22d6c005e7ad..174bc7ed877f3 100644 --- a/tests/player_activities_test.cpp +++ b/tests/player_activities_test.cpp @@ -178,7 +178,7 @@ TEST_CASE( "safecracking", "[activity][safecracking]" ) clear_avatar(); clear_map(); - tripoint safe; + tripoint_bub_ms safe; dummy.setpos( safe + tripoint_east ); map &mp = get_map(); @@ -281,7 +281,7 @@ TEST_CASE( "safecracking", "[activity][safecracking]" ) clear_avatar(); clear_map(); - tripoint safe; + tripoint_bub_ms safe; dummy.setpos( safe + tripoint_east ); map &mp = get_map(); @@ -1726,7 +1726,7 @@ static const std::vector> test_activities { item::reload_option opt( dummy, target, ammo ); return player_activity( reload_activity_actor( std::move( opt ) ) ); }, - [] { return player_activity( safecracking_activity_actor( get_avatar().pos() + tripoint_north ) ); }, + [] { return player_activity( safecracking_activity_actor( get_avatar().pos_bub() + tripoint_rel_ms_north ) ); }, [] { return player_activity( shave_activity_actor() ); }, //player_activity( shearing_activity_actor( north ) ), [] { return player_activity( stash_activity_actor() ); },