Skip to content

Commit

Permalink
Clearing rubble makes creature under it free. (#34295)
Browse files Browse the repository at this point in the history
* Clearing rubble makes creature under it free.

* Removed redundant check.
  • Loading branch information
ipcyborg authored and ZhilkinSerg committed Sep 28, 2019
1 parent fcc1976 commit 5397a70
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1290,6 +1290,13 @@ void map::furn_set( const tripoint &p, const furn_id &new_furniture )
add_msg( _( "The %s you were grabbing is destroyed!" ), old_t.name() );
g->u.grab( OBJECT_NONE );
}
// If a creature was crushed under a rubble -> free it
if( old_id == f_rubble && new_furniture == f_null ) {
Creature *c = g->critter_at( p );
if( c ) {
c->remove_effect( effect_crushed );
}
}
if( new_t.has_flag( "EMITTER" ) ) {
field_furn_locs.push_back( p );
}
Expand Down

0 comments on commit 5397a70

Please sign in to comment.