From 1f1712d6e161dd3923bce9cd75c88483b425826e Mon Sep 17 00:00:00 2001 From: Jamuro-g <76928284+Jamuro-g@users.noreply.github.com> Date: Sun, 14 Mar 2021 21:53:54 +0100 Subject: [PATCH] prevent bell spam (#47987) --- src/computer_session.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/computer_session.cpp b/src/computer_session.cpp index df4de3fcadefe..0aaf5995ed18d 100644 --- a/src/computer_session.cpp +++ b/src/computer_session.cpp @@ -405,12 +405,21 @@ void computer_session::action_unlock() query_any( _( "Lock disabled. Press any key…" ) ); } -//Toll is required for the church computer/mechanism to function +//Toll is required for the church/school computer/mechanism to function void computer_session::action_toll() { - sounds::sound( get_player_character().pos(), 120, sounds::sound_t::music, - //~ the sound of a church bell ringing - _( "Bohm… Bohm… Bohm…" ), true, "environment", "church_bells" ); + if( calendar::turn < comp.next_attempt ) { + print_error( _( "[Bellsystem 1.2] is currently in use." ) ); + query_any( _( "Please wait for at least one minute." ) ); + reset_terminal(); + } else { + comp.next_attempt = calendar::turn + 1_minutes; + sounds::sound( get_player_character().pos(), 120, sounds::sound_t::music, + //~ the sound of a church bell ringing + _( "Bohm… Bohm… Bohm…" ), true, "environment", "church_bells" ); + + query_any( _( "[Bellsystem 1.2] activated. Have a nice day." ) ); + } } void computer_session::action_sample()