Skip to content

Commit

Permalink
Allow "using" to coexist with other vpart reqs
Browse files Browse the repository at this point in the history
There were two ways to specify vehicle part installation requirements.
Either with "using" or with standard requirements ("components",
"qualities", and "tools").  Previously the two were mutually exclusive,
but some parts tried to use both.  There's no reason we should prevent
that, so allow both to be used.
  • Loading branch information
jbytheway committed Oct 7, 2019
1 parent 5a818d5 commit 0c235ad
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/veh_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,13 @@ static void parse_vp_reqs( JsonObject &obj, const std::string &id, const std::st
reqs.emplace_back( requirement_id( cur.get_string( 0 ) ), cur.get_int( 1 ) );
}

} else {
const requirement_id req_id( string_format( "inline_%s_%s", key.c_str(), id.c_str() ) );
requirement_data::load_requirement( src, req_id );
reqs = { { req_id, 1 } };
}

// Construct a requirement to capture "components", "qualities", and
// "tools" that might be listed.
const requirement_id req_id( string_format( "inline_%s_%s", key.c_str(), id.c_str() ) );
requirement_data::load_requirement( src, req_id );
reqs.emplace_back( req_id, 1 );
}

/**
Expand Down

0 comments on commit 0c235ad

Please sign in to comment.