diff --git a/data/json/vehicleparts/vehicle_parts.json b/data/json/vehicleparts/vehicle_parts.json index 3e168fd34835c..bd4451f9823b0 100644 --- a/data/json/vehicleparts/vehicle_parts.json +++ b/data/json/vehicleparts/vehicle_parts.json @@ -1231,7 +1231,7 @@ "removal": { "skills": [ [ "mechanics", 1 ] ], "time": "1 m", "using": [ [ "vehicle_screw", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 1 ] ], "time": "30 s", "using": [ [ "adhesive", 1 ] ] } }, - "flags": [ "CTRL_ELECTRONIC", "ENABLED_DRAINS_EPOWER", "SPACE_HEATER", "EMITTER" ], + "flags": [ "CTRL_ELECTRONIC", "ENABLED_DRAINS_EPOWER", "SPACE_HEATER" ], "emissions": [ "emit_heater_vehicle" ], "breaks_into": [ { "item": "steel_lump" }, { "item": "steel_chunk", "count": [ 1, 3 ] }, { "item": "scrap", "count": [ 1, 3 ] } ], "damage_reduction": { "all": 15 } @@ -1254,7 +1254,7 @@ "removal": { "skills": [ [ "mechanics", 1 ] ], "time": "1 m", "using": [ [ "vehicle_screw", 1 ] ] }, "repair": { "skills": [ [ "mechanics", 1 ] ], "time": "30 s", "using": [ [ "adhesive", 1 ] ] } }, - "flags": [ "CTRL_ELECTRONIC", "ENABLED_DRAINS_EPOWER", "COOLER", "EMITTER" ], + "flags": [ "CTRL_ELECTRONIC", "ENABLED_DRAINS_EPOWER", "COOLER" ], "emissions": [ "emit_cooler_vehicle" ], "exhaust": [ "emit_heater_vehicle" ], "breaks_into": [ { "item": "steel_lump" }, { "item": "steel_chunk", "count": [ 1, 3 ] }, { "item": "scrap", "count": [ 1, 3 ] } ], diff --git a/doc/JSON_FLAGS.md b/doc/JSON_FLAGS.md index deb538d75b5c2..38e90356c2913 100644 --- a/doc/JSON_FLAGS.md +++ b/doc/JSON_FLAGS.md @@ -1382,7 +1382,6 @@ Those flags are added by the game code to specific items (for example, that spec - ```E_HEATER``` Is an engine and has a heater to warm internal vehicle items when on. - ```E_HIGHER_SKILL``` Is an engine that is more difficult to install as more engines are installed. - ```E_STARTS_INSTANTLY``` Is an engine that starts instantly, like food pedals. -- ```EMITTER``` Is a part has emission (defined in ```emissions```). - ```FLAT_SURF``` Part with a flat hard surface (e.g. table). - ```FOLDABLE``` - ```FREEZER``` Can freeze items in below zero degrees Celsius temperature. diff --git a/src/veh_type.cpp b/src/veh_type.cpp index 8e3e740177a09..ce6166cc80fef 100644 --- a/src/veh_type.cpp +++ b/src/veh_type.cpp @@ -730,31 +730,20 @@ void vpart_info::check() if( part.has_flag( "TURRET" ) && !base_item_type.gun ) { debugmsg( "vehicle part %s has the TURRET flag, but is not made from a gun item", part.id.c_str() ); } - if( !part.emissions.empty() && !part.has_flag( "EMITTER" ) ) { - debugmsg( "vehicle part %s has emissions set, but the EMITTER flag is not set", part.id.c_str() ); - } - if( !part.exhaust.empty() && !part.has_flag( "EMITTER" ) ) { - debugmsg( "vehicle part %s has exhaust set, but the EMITTER flag is not set", part.id.c_str() ); + + for( const emit_id &e : part.emissions ) { + if( !e.is_valid() ) { + debugmsg( "vehicle part %s has invalid emission %s was set", + part.id.c_str(), e.str().c_str() ); + } } - if( part.has_flag( "EMITTER" ) ) { - if( part.emissions.empty() && part.exhaust.empty() ) { - debugmsg( "vehicle part %s has the EMITTER flag, but no emissions or exhaust were set", - part.id.c_str() ); - } else { - for( const emit_id &e : part.emissions ) { - if( !e.is_valid() ) { - debugmsg( "vehicle part %s has the EMITTER flag, but invalid emission %s was set", - part.id.c_str(), e.str().c_str() ); - } - } - for( const emit_id &e : part.exhaust ) { - if( !e.is_valid() ) { - debugmsg( "vehicle part %s has the EMITTER flag, but invalid exhaust %s was set", - part.id.c_str(), e.str().c_str() ); - } - } + for( const emit_id &e : part.exhaust ) { + if( !e.is_valid() ) { + debugmsg( "vehicle part %s has invalid exhaust %s was set", + part.id.c_str(), e.str().c_str() ); } } + if( part.has_flag( "WHEEL" ) && !base_item_type.wheel ) { debugmsg( "vehicle part %s has the WHEEL flag, but base item %s is not a wheel. " "THIS WILL CRASH!", part.id.str(), part.base_item.str() ); diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 25777edc3b5f2..ea454f17f1c74 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -5805,7 +5805,7 @@ void vehicle::refresh() if( vpi.has_flag( "UNMOUNT_ON_MOVE" ) ) { loose_parts.push_back( p ); } - if( vpi.has_flag( "EMITTER" ) ) { + if( !vpi.emissions.empty() || !vpi.exhaust.empty() ) { emitters.push_back( p ); } if( vpi.has_flag( VPFLAG_WHEEL ) ) {