Skip to content

Commit

Permalink
Use the right vehicle positions (CleverRaven#60527)
Browse files Browse the repository at this point in the history
  • Loading branch information
irwiss authored Aug 29, 2022
1 parent 8f89856 commit dbfff17
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/activity_actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ std::unique_ptr<activity_actor> hacksaw_activity_actor::deserialize( JsonValue &
bikerack_racking_activity_actor::bikerack_racking_activity_actor( vehicle &parent_vehicle,
std::vector<std::vector<int>> parts ) : parts( std::move( parts ) )
{
parent_vehicle_pos = parent_vehicle.pos_bub();
parent_vehicle_pos = parent_vehicle.bub_part_pos( 0 );
}

void bikerack_racking_activity_actor::start( player_activity &act, Character & )
Expand Down Expand Up @@ -1187,7 +1187,7 @@ bikerack_unracking_activity_actor::bikerack_unracking_activity_actor( vehicle &p
std::vector<int> parts, std::vector<int> racks )
: parts( std::move( parts ) ), racks( std::move( racks ) )
{
parent_vehicle_pos = parent_vehicle.pos_bub();
parent_vehicle_pos = parent_vehicle.bub_part_pos( 0 );
}

void bikerack_unracking_activity_actor::start( player_activity &act, Character & )
Expand Down
2 changes: 1 addition & 1 deletion src/handle_liquid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static void serialize_liquid_target( player_activity &act, const vpart_reference
{
act.values.push_back( static_cast<int>( liquid_target_type::VEHICLE ) );
act.values.push_back( 0 ); // dummy
act.coords.push_back( vp.vehicle().global_pos3() );
act.coords.push_back( vp.vehicle().global_part_pos3( 0 ) );
act.values.push_back( vp.part_index() ); // tank part index
}

Expand Down
2 changes: 2 additions & 0 deletions src/vehicle.h
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,9 @@ class vehicle
// Returns the location of the vehicle in global overmap terrain coordinates.
tripoint_abs_omt global_omt_location() const;
// Returns the coordinates (in map squares) of the vehicle relative to the local map.
// Warning: Don't assume this position contains a vehicle part
tripoint global_pos3() const;
// Warning: Don't assume this position contains a vehicle part
tripoint_bub_ms pos_bub() const;
/**
* Get the coordinates of the studied part of the vehicle
Expand Down

0 comments on commit dbfff17

Please sign in to comment.