Skip to content

Commit

Permalink
[bugfix] Respect rot_spawn_chance
Browse files Browse the repository at this point in the history
I broke it in CleverRaven#48116,
made it treat everything as if it had rot_spawn_chance = 100. Was most
noticable for unfertilized eggs, which really shouldn't hatch.
  • Loading branch information
Musteval committed May 23, 2021
1 parent b533bda commit b3bf231
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6988,13 +6988,16 @@ void map::rotten_item_spawn( const item &item, const tripoint &pnt )
if( mgroup.is_null() ) {
return;
}
MonsterGroupResult spawn_details = MonsterGroupManager::GetResultFromGroup( mgroup );
add_spawn( spawn_details, pnt );
if( get_player_view().sees( pnt ) ) {
if( item.is_seed() ) {
add_msg( m_warning, _( "Something has crawled out of the %s plants!" ), item.get_plant_name() );
} else {
add_msg( m_warning, _( "Something has crawled out of the %s!" ), item.tname() );

if( rng( 0, 100 ) < comest->rot_spawn_chance ) {
MonsterGroupResult spawn_details = MonsterGroupManager::GetResultFromGroup( mgroup );
add_spawn( spawn_details, pnt );
if( get_player_view().sees( pnt ) ) {
if( item.is_seed() ) {
add_msg( m_warning, _( "Something has crawled out of the %s plants!" ), item.get_plant_name() );
} else {
add_msg( m_warning, _( "Something has crawled out of the %s!" ), item.tname() );
}
}
}
}
Expand Down

0 comments on commit b3bf231

Please sign in to comment.