Skip to content

Commit

Permalink
fix frozen acid drops (CleverRaven#33350)
Browse files Browse the repository at this point in the history
  • Loading branch information
misterprimus committed Sep 21, 2019
1 parent 8845e83 commit 075d2e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
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": "250 ml",
"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": "250 ml",
"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

0 comments on commit 075d2e5

Please sign in to comment.