Skip to content

Commit

Permalink
Fix opening and closing fake vehicle parts
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingranade committed May 3, 2022
1 parent 89840db commit 8cdfd9c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2700,7 +2700,7 @@ void vpart_position::set_label( const std::string &text ) const

int vehicle::next_part_to_close( int p, bool outside ) const
{
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true );
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true, true );

// We want reverse, since we close the outermost thing first (curtains), and then the innermost thing (door)
for( std::vector<int>::reverse_iterator part_it = parts_here.rbegin();
Expand All @@ -2719,7 +2719,7 @@ int vehicle::next_part_to_close( int p, bool outside ) const

int vehicle::next_part_to_open( int p, bool outside ) const
{
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true );
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true, true );

// We want forwards, since we open the innermost thing first (curtains), and then the innermost thing (door)
for( const int &elem : parts_here ) {
Expand Down
2 changes: 1 addition & 1 deletion src/vehicle_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,7 @@ bool vehicle::can_close( int part_index, Character &who )

void vehicle::open_all_at( int p )
{
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true );
std::vector<int> parts_here = parts_at_relative( parts[p].mount, true, true );
for( auto &elem : parts_here ) {
if( part_flag( elem, VPFLAG_OPENABLE ) ) {
// Note that this will open multi-square and non-multipart parts in the tile. This
Expand Down

0 comments on commit 8cdfd9c

Please sign in to comment.