Skip to content

Commit

Permalink
Solar panels are not repairable (#34546)
Browse files Browse the repository at this point in the history
* can't repair any solar panel item

* can't repair solar panel vehicle part

* NO_REPAIR flag is valid even for vehicle with TOOL_WRENCH flag
  • Loading branch information
Fris0uman authored and ZhilkinSerg committed Oct 8, 2019
1 parent 44daa0d commit 9f71965
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
1 change: 1 addition & 0 deletions data/json/items/vehicle/solar.json
Expand Up @@ -11,6 +11,7 @@
"material": [ "glass" ],
"volume": "3 L",
"bashing": 1,
"flags": [ "NO_REPAIR" ],
"category": "veh_parts",
"price": 90000
},
Expand Down
2 changes: 1 addition & 1 deletion data/json/vehicleparts/vehicle_parts.json
Expand Up @@ -1737,7 +1737,7 @@
"item": "solar_panel",
"difficulty": 4,
"location": "on_roof",
"flags": [ "SOLAR_PANEL", "TOOL_WRENCH" ],
"flags": [ "SOLAR_PANEL", "TOOL_WRENCH", "NO_REPAIR" ],
"breaks_into": [
{ "item": "steel_lump", "count": [ 2, 4 ] },
{ "item": "steel_chunk", "count": [ 2, 4 ] },
Expand Down
15 changes: 9 additions & 6 deletions src/veh_type.cpp
Expand Up @@ -520,18 +520,21 @@ void vpart_info::check()
if( part.has_flag( "TOOL_WRENCH" ) || part.has_flag( "WHEEL" ) ) {
part.install_reqs = { { requirement_id( "vehicle_bolt" ), 1 } };
part.removal_reqs = { { requirement_id( "vehicle_bolt" ), 1 } };
part.repair_reqs = { { requirement_id( "welding_standard" ), 5 } };

if( !part.has_flag( "NO_REPAIR" ) ) {
part.repair_reqs = { { requirement_id( "welding_standard" ), 5 } };
}
} else if( part.has_flag( "TOOL_SCREWDRIVER" ) ) {
part.install_reqs = { { requirement_id( "vehicle_screw" ), 1 } };
part.removal_reqs = { { requirement_id( "vehicle_screw" ), 1 } };
part.repair_reqs = { { requirement_id( "adhesive" ), 1 } };

if( !part.has_flag( "NO_REPAIR" ) ) {
part.repair_reqs = { { requirement_id( "adhesive" ), 1 } };
}
} else if( part.has_flag( "NAILABLE" ) ) {
part.install_reqs = { { requirement_id( "vehicle_nail_install" ), 1 } };
part.removal_reqs = { { requirement_id( "vehicle_nail_removal" ), 1 } };
part.repair_reqs = { { requirement_id( "adhesive" ), 2 } };

if( !part.has_flag( "NO_REPAIR" ) ) {
part.repair_reqs = { { requirement_id( "adhesive" ), 2 } };
}
} else if( part.has_flag( "TOOL_NONE" ) ) {
// no-op

Expand Down

0 comments on commit 9f71965

Please sign in to comment.