Prevent searching or waiting next to a hostile
Generally speaking there's no reason to wait or search next to a hostile monster, so let's just prevent those actions. You can still do those commands by prefixing them with the 'm' prefix.
This commit is contained in:
@@ -2995,6 +2995,8 @@ int NDECL((*cmd_func));
|
||||
|| cmd_func == doloot
|
||||
/* travel: pop up a menu of interesting targets in view */
|
||||
|| cmd_func == dotravel
|
||||
/* wait and search: allow even if next to a hostile monster */
|
||||
|| cmd_func == donull || cmd_func == dosearch
|
||||
/* wizard mode ^V and ^T */
|
||||
|| cmd_func == wiz_level_tele || cmd_func == dotelecmd
|
||||
/* 'm' prefix allowed for some extended commands */
|
||||
|
||||
@@ -1782,6 +1782,10 @@ register int aflag; /* intrinsic autosearch vs explicit searching */
|
||||
int
|
||||
dosearch()
|
||||
{
|
||||
if (!iflags.menu_requested && !g.multi && monster_nearby()) {
|
||||
Norep("You already found a monster.");
|
||||
return 0;
|
||||
}
|
||||
return dosearch0(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user