From 59f8957e45294df4bb8d3fe0093c6848a0363a72 Mon Sep 17 00:00:00 2001 From: Valiant Date: Mon, 11 Nov 2024 16:54:36 +0400 Subject: [PATCH 1/4] Add starting ammo to creatures spawned via `place_critter_within` --- src/game.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/game.cpp b/src/game.cpp index 01192b1e1c59f..e50701835ceaf 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -5104,7 +5104,9 @@ monster *game::place_critter_within( const mtype_id &id, const tripoint_range( id ), range ); + shared_ptr_fast mon = make_shared_fast( id ); + mon->ammo = mon->type->starting_ammo; + return place_critter_within( mon, range ); } monster *game::place_critter_within( const shared_ptr_fast &mon, From 8aeaab6e3b865d53339920c46d2977f365fe9b21 Mon Sep 17 00:00:00 2001 From: Valiant Date: Mon, 11 Nov 2024 16:56:51 +0400 Subject: [PATCH 2/4] Removed senseless 1-cycle loop Also updated description to mention secubot rather than secubots. --- src/computer_session.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/computer_session.cpp b/src/computer_session.cpp index 4819d5aa26402..c16e5fb781e85 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -1634,13 +1634,10 @@ void computer_session::failure_manhacks() void computer_session::failure_secubots() { - int num_robots = 1; const tripoint_range 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, _( "Secubot emerge from compartment in the floor." ) ); } } From 503a4944b5dee583e9248ef7f71d8b71b2706c80 Mon Sep 17 00:00:00 2001 From: Valiant Date: Mon, 11 Nov 2024 21:59:28 +0400 Subject: [PATCH 3/4] Grammar --- src/computer_session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/computer_session.cpp b/src/computer_session.cpp index c16e5fb781e85..51442c79070d4 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -1637,7 +1637,7 @@ void computer_session::failure_secubots() const tripoint_range range = get_map().points_in_radius( get_player_character().pos(), 3 ); if( g->place_critter_within( mon_secubot, range ) ) { - add_msg( m_warning, _( "Secubot emerge from compartment in the floor." ) ); + add_msg( m_warning, _( "Secubot emerges from compartment in the floor." ) ); } } From 71760f6074be33378fa320428b8dc595a1a24b85 Mon Sep 17 00:00:00 2001 From: Anton Burmistrov Date: Mon, 11 Nov 2024 22:44:57 +0400 Subject: [PATCH 4/4] Update src/computer_session.cpp Co-authored-by: Karol1223 <68503002+Karol1223@users.noreply.github.com> --- src/computer_session.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/computer_session.cpp b/src/computer_session.cpp index 51442c79070d4..441d6dfc5a3db 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -1637,7 +1637,7 @@ void computer_session::failure_secubots() const tripoint_range range = get_map().points_in_radius( get_player_character().pos(), 3 ); if( g->place_critter_within( mon_secubot, range ) ) { - add_msg( m_warning, _( "Secubot emerges from compartment in the floor." ) ); + add_msg( m_warning, _( "A secubot emerges from a compartment in the floor." ) ); } }