1 #include "core/disturbance.h"
2 #include "action/travel-execution.h"
3 #include "core/player-redraw-types.h"
4 #include "core/player-update-types.h"
5 #include "game-option/disturbance-options.h"
6 #include "game-option/map-screen-options.h"
7 #include "io/input-key-requester.h"
8 #include "player/attack-defense-types.h"
9 #include "status/action-setter.h"
10 #include "target/target-checker.h"
11 #include "term/screen-processor.h"
14 * Something has happened to disturb the player.
15 * The first arg indicates a major disturbance, which affects search.
16 * The second arg is currently unused, but could induce output flush.
17 * All disturbance cancels repeated commands, resting, and running.
19 void disturb(player_type *creature_ptr, bool stop_search, bool stop_travel)
23 creature_ptr->redraw |= PR_STATE;
26 if ((creature_ptr->action == ACTION_REST) || (creature_ptr->action == ACTION_FISH) || (stop_search && (creature_ptr->action == ACTION_SEARCH)))
27 set_action(creature_ptr, ACTION_NONE);
29 if (creature_ptr->running) {
30 creature_ptr->running = 0;
31 if (center_player && !center_running)
32 verify_panel(creature_ptr);
34 creature_ptr->update |= PU_TORCH;
35 creature_ptr->update |= PU_FLOW;
40 if (center_player && !center_running)
41 verify_panel(creature_ptr);
43 creature_ptr->update |= PU_TORCH;