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 frozen acid drops #33350

Merged
merged 4 commits into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
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
7 changes: 6 additions & 1 deletion data/json/items/chemicals_and_resources.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@
"name_plural": "concentrated acid",
"weight": 250,
"color": "green",
"flags": [ "ACID" ],
"flags": [ "ACID", "DROP_ACTION_ONLY_IF_LIQUID" ],
"use_action": "BLECH",
"container": "jug_plastic",
"comestible_type": "DRINK",
Expand All @@ -391,6 +391,7 @@
"phase": "liquid",
"category": "chems",
"fun": -45,
"freezing_point": 25,
"drop_action": { "type": "emit_actor", "emits": [ "emit_acid_splash" ], "scale_qty": true }
},
{
Expand Down Expand Up @@ -458,6 +459,7 @@
"name_plural": "sulfuric acid",
"symbol": "=",
"color": "white",
"flags": [ "DROP_ACTION_ONLY_IF_LIQUID" ],
"description": "Sulfuric acid: viscous, foul-smelling and extremely corrosive, particularly to organic matter and evil clowns. Although used to prepare a number of chemicals, it is mostly known as battery acid, due to its widest commercial application.",
"volume": 1,
"weight": 460,
Expand All @@ -466,6 +468,7 @@
"charges": 2,
"phase": "liquid",
"container": "bottle_glass",
"freezing_point": 25,
"drop_action": { "type": "emit_actor", "emits": [ "emit_acid_drop" ], "scale_qty": true }
},
{
Expand Down Expand Up @@ -494,6 +497,7 @@
"name_plural": "nitric acid",
"symbol": "=",
"color": "white",
"flags": [ "DROP_ACTION_ONLY_IF_LIQUID" ],
"description": "Nitric acid, a strong oxidant and extremely corrosive material. Mainly used in the production of synthetic fertilizers, for etching of circuit boards and in woodworking. Remains quite useful both for making a vast array of pyrotechnic and explosive agents and as a direct weapon: not many beings enjoy being doused in nitric acid.",
"volume": 1,
"weight": 375,
Expand All @@ -502,6 +506,7 @@
"charges": 2,
"phase": "liquid",
"container": "bottle_glass",
"freezing_point": -44,
"drop_action": { "type": "emit_actor", "emits": [ "emit_acid_drop" ], "scale_qty": true }
},
{
Expand Down
15 changes: 9 additions & 6 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4287,10 +4287,12 @@ item &map::add_item_or_charges( const tripoint &pos, item obj, bool overflow )
if( ( !has_flag( "NOITEM", pos ) || ( has_flag( "LIQUIDCONT", pos ) && obj.made_of( LIQUID ) ) )
&& valid_limits( pos ) ) {
// Pass map into on_drop, because this map may not be the global map object (in mapgen, for instance).
if( obj.on_drop( pos, *this ) ) {
return null_item_reference();
}
if( obj.made_of( LIQUID ) || !obj.has_flag( "DROP_ACTION_ONLY_IF_LIQUID" ) ) {
if( obj.on_drop( pos, *this ) ) {
return null_item_reference();
}

}
// If tile can contain items place here...
return place_item( pos );

Expand All @@ -4302,9 +4304,10 @@ item &map::add_item_or_charges( const tripoint &pos, item obj, bool overflow )
if( !inbounds( e ) ) {
continue;
}

if( obj.on_drop( e, *this ) ) {
return null_item_reference();
if( obj.made_of( LIQUID ) || !obj.has_flag( "DROP_ACTION_ONLY_IF_LIQUID" ) ) {
if( obj.on_drop( e, *this ) ) {
return null_item_reference();
}
}

if( !valid_tile( e ) || !valid_limits( e ) ||
Expand Down