Skip to content

Commit

Permalink
add PULPED flag and check for can_revive() in necromancer attack
Browse files Browse the repository at this point in the history
  • Loading branch information
Fris0uman authored and kevingranade committed Sep 22, 2019
1 parent ca17316 commit 2c0e8e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/activity_handlers.cpp
Expand Up @@ -1796,6 +1796,7 @@ void activity_handlers::pulp_do_turn( player_activity *act, player *p )
return;
}
}
corpse.set_flag( "PULPED" );
}
// If we reach this, all corpses have been pulped, finish the activity
act->moves_left = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Expand Up @@ -4648,7 +4648,7 @@ bool item::can_revive() const
{
return is_corpse() && corpse->has_flag( MF_REVIVES ) && damage() < max_damage() &&
!( has_flag( "FIELD_DRESS" ) || has_flag( "FIELD_DRESS_FAILED" ) || has_flag( "QUARTERED" ) ||
has_flag( "SKINNED" ) );
has_flag( "SKINNED" ) || has_flag( "PULPED" ) );
}

bool item::ready_to_revive( const tripoint &pos ) const
Expand Down
2 changes: 1 addition & 1 deletion src/monattack.cpp
Expand Up @@ -889,7 +889,7 @@ bool mattack::resurrect( monster *z )

for( auto &i : g->m.i_at( p ) ) {
const mtype *mt = i.get_mtype();
if( !( i.is_corpse() && i.active && mt->has_flag( MF_REVIVES ) &&
if( !( i.is_corpse() && i.can_revive() && i.active && mt->has_flag( MF_REVIVES ) &&
mt->in_species( ZOMBIE ) && !mt->has_flag( MF_NO_NECRO ) ) ) {
continue;
}
Expand Down

0 comments on commit 2c0e8e6

Please sign in to comment.