Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for player being unable to use most vehicle mounted tools in crafting #40383

Merged
merged 2 commits into from
May 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions src/inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,8 +537,9 @@ void inventory::form_from_map( map &m, std::vector<tripoint> pts, const Characte
}

if( kpart ) {
int veh_battery = veh->fuel_left( "battery", true );
item hotplate( "hotplate", 0 );
hotplate.charges = veh->fuel_left( "battery", true );
hotplate.ammo_set( hotplate.ammo_default(), veh_battery );
hotplate.item_tags.insert( "PSEUDO" );
add_item( hotplate );

Expand All @@ -550,57 +551,62 @@ void inventory::form_from_map( map &m, std::vector<tripoint> pts, const Characte
add_item( pan );
}
if( weldpart ) {
int veh_battery = veh->fuel_left( "battery", true );
item welder( "welder", 0 );
welder.charges = veh->fuel_left( "battery", true );
welder.ammo_set( welder.ammo_default(), veh_battery );
welder.item_tags.insert( "PSEUDO" );
add_item( welder );

item soldering_iron( "soldering_iron", 0 );
soldering_iron.charges = veh->fuel_left( "battery", true );
soldering_iron.ammo_set( soldering_iron.ammo_default(), veh_battery );
soldering_iron.item_tags.insert( "PSEUDO" );
add_item( soldering_iron );
}
if( craftpart ) {
int veh_battery = veh->fuel_left( "battery", true );
item vac_sealer( "vac_sealer", 0 );
vac_sealer.charges = veh->fuel_left( "battery", true );
vac_sealer.ammo_set( vac_sealer.ammo_default(), veh_battery );
vac_sealer.item_tags.insert( "PSEUDO" );
add_item( vac_sealer );

item dehydrator( "dehydrator", 0 );
dehydrator.charges = veh->fuel_left( "battery", true );
dehydrator.ammo_set( dehydrator.ammo_default(), veh_battery ) ;
dehydrator.item_tags.insert( "PSEUDO" );
add_item( dehydrator );

item food_processor( "food_processor", 0 );
food_processor.charges = veh->fuel_left( "battery", true );
food_processor.ammo_set( food_processor.ammo_default(), veh_battery ) ;
food_processor.item_tags.insert( "PSEUDO" );
add_item( food_processor );

item press( "press", 0 );
press.charges = veh->fuel_left( "battery", true );
press.ammo_set( press.ammo_default(), veh_battery );
press.item_tags.insert( "PSEUDO" );
add_item( press );
}
if( forgepart ) {
int veh_battery = veh->fuel_left( "battery", true );
item forge( "forge", 0 );
forge.charges = veh->fuel_left( "battery", true );
forge.ammo_set( forge.ammo_default(), veh_battery );
forge.item_tags.insert( "PSEUDO" );
add_item( forge );
}
if( kilnpart ) {
int veh_battery = veh->fuel_left( "battery", true );
item kiln( "kiln", 0 );
kiln.charges = veh->fuel_left( "battery", true );
kiln.ammo_set( kiln.ammo_default(), veh_battery );
kiln.item_tags.insert( "PSEUDO" );
add_item( kiln );
}
if( chempart ) {
int veh_battery = veh->fuel_left( "battery", true );
item chemistry_set( "chemistry_set", 0 );
chemistry_set.charges = veh->fuel_left( "battery", true );
chemistry_set.ammo_set( chemistry_set.ammo_default(), veh_battery );
chemistry_set.item_tags.insert( "PSEUDO" );
add_item( chemistry_set );

item electrolysis_kit( "electrolysis_kit", 0 );
electrolysis_kit.charges = veh->fuel_left( "battery", true );
electrolysis_kit.ammo_set( electrolysis_kit.ammo_default(), veh_battery );
electrolysis_kit.item_tags.insert( "PSEUDO" );
add_item( electrolysis_kit );
}
Expand Down