Skip to content

Commit

Permalink
No magic dissectables
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed May 9, 2024
1 parent eefe407 commit 975b4bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3078,14 +3078,17 @@ void monster::drop_items_on_death( item *corpse )
}
}

void monster::spawn_dissectables_on_death( item *corpse )
void monster::spawn_dissectables_on_death( item *corpse ) const
{
if( is_hallucination() ) {
return;
}
if( type->dissect.is_empty() ) {
return;
}
if( !corpse ) {
return;
}

for( const harvest_entry &entry : *type->dissect ) {
std::vector<item> dissectables = item_group::items_from( item_group_id( entry.drop ),
Expand All @@ -3101,8 +3104,6 @@ void monster::spawn_dissectables_on_death( item *corpse )
}
if( corpse ) {
corpse->put_in( dissectable, pocket_type::CORPSE );
} else {
get_map().add_item_or_charges( pos(), dissectable );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/monster.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class monster : public Creature

void die( Creature *killer ) override; //this is the die from Creature, it calls kill_mo
void drop_items_on_death( item *corpse );
void spawn_dissectables_on_death( item *corpse ); //spawn dissectable CBMs into CORPSE pocket
void spawn_dissectables_on_death( item *corpse ) const; //spawn dissectable CBMs into CORPSE pocket
//spawn monster's inventory without killing it
void generate_inventory( bool disableDrops = true );

Expand Down

0 comments on commit 975b4bd

Please sign in to comment.