Skip to content

Commit

Permalink
Merge pull request #77762 from Night-Pryanik/secubot
Browse files Browse the repository at this point in the history
Monsters spawned via `place_critter_within` now gain ammo on spawn
  • Loading branch information
Maleclypse authored Nov 15, 2024
2 parents 36181ca + 71760f6 commit 537adea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/computer_session.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1634,13 +1634,10 @@ void computer_session::failure_manhacks()

void computer_session::failure_secubots()
{
int num_robots = 1;
const tripoint_range<tripoint> range =
get_map().points_in_radius( get_player_character().pos(), 3 );
for( int i = 0; i < num_robots; i++ ) {
if( g->place_critter_within( mon_secubot, range ) ) {
add_msg( m_warning, _( "Secubots emerge from compartments in the floor." ) );
}
if( g->place_critter_within( mon_secubot, range ) ) {
add_msg( m_warning, _( "A secubot emerges from a compartment in the floor." ) );
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5111,7 +5111,9 @@ monster *game::place_critter_within( const mtype_id &id, const tripoint_range<tr
if( id.is_null() ) {
return nullptr;
}
return place_critter_within( make_shared_fast<monster>( id ), range );
shared_ptr_fast<monster> mon = make_shared_fast<monster>( id );
mon->ammo = mon->type->starting_ammo;
return place_critter_within( mon, range );
}

monster *game::place_critter_within( const shared_ptr_fast<monster> &mon,
Expand Down

0 comments on commit 537adea

Please sign in to comment.