From e89e89bcba201c6acc0d9c054693bb3dfe4e2969 Mon Sep 17 00:00:00 2001 From: John Bytheway Date: Thu, 3 Oct 2019 20:40:11 -0400 Subject: [PATCH] Allow "using" to coexist with other vpart reqs 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. --- src/veh_type.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/veh_type.cpp b/src/veh_type.cpp index 6ea3fb40f3741..2dfdad49f69fa 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -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 ); } /**