Skip to content

Commit

Permalink
'Adding special items to monster inventory' section is now triggered …
Browse files Browse the repository at this point in the history
…earlier than 'Dropping items from monster inventory' section (#62615)
  • Loading branch information
Night-Pryanik authored Dec 9, 2022
1 parent 52279d7 commit 6e617f6
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions src/monster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2645,6 +2645,26 @@ void monster::die( Creature *nkiller )
break;
}

if( death_drops ) {
// Drop items stored in optionals
move_special_item_to_inv( tack_item );
move_special_item_to_inv( armor_item );
move_special_item_to_inv( storage_item );
move_special_item_to_inv( tied_item );

if( has_effect( effect_lightsnare ) ) {
add_item( item( "string_36", calendar::turn_zero ) );
add_item( item( "snare_trigger", calendar::turn_zero ) );
}
if( has_effect( effect_heavysnare ) ) {
add_item( item( "rope_6", calendar::turn_zero ) );
add_item( item( "snare_trigger", calendar::turn_zero ) );
}
if( has_effect( effect_beartrap ) ) {
add_item( item( "beartrap", calendar::turn_zero ) );
}
}

if( death_drops && !no_extra_death_drops ) {
drop_items_on_death( corpse );
spawn_dissectables_on_death( corpse );
Expand All @@ -2665,25 +2685,6 @@ void monster::die( Creature *nkiller )
}
}
}
if( death_drops ) {
// Drop items stored in optionals
move_special_item_to_inv( tack_item );
move_special_item_to_inv( armor_item );
move_special_item_to_inv( storage_item );
move_special_item_to_inv( tied_item );

if( has_effect( effect_lightsnare ) ) {
add_item( item( "string_36", calendar::turn_zero ) );
add_item( item( "snare_trigger", calendar::turn_zero ) );
}
if( has_effect( effect_heavysnare ) ) {
add_item( item( "rope_6", calendar::turn_zero ) );
add_item( item( "snare_trigger", calendar::turn_zero ) );
}
if( has_effect( effect_beartrap ) ) {
add_item( item( "beartrap", calendar::turn_zero ) );
}
}

// Adjust anger/morale of nearby monsters, if they have the appropriate trigger and are friendly
// Keep filtering on the dying monsters' triggers to preserve current functionality
Expand Down

0 comments on commit 6e617f6

Please sign in to comment.