Skip to content

Commit

Permalink
Merge pull request CleverRaven#49007 from MarlossCDDA/marloss/fix-rot…
Browse files Browse the repository at this point in the history
…-spawn-chance

[bugfix] Respect rot_spawn_chance so unfertilized eggs don't hatch
  • Loading branch information
Rivet-the-Zombie authored May 24, 2021
2 parents b533bda + b3bf231 commit b6c4ce5
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 b6c4ce5

Please sign in to comment.