/*
* Determine if a grid contains a chest
*/
-static s16b chest_check(int y, int x)
+static s16b chest_check(int y, int x, bool trapped)
{
cave_type *c_ptr = &cave[y][x];
/* Skip unknown chests XXX XXX */
/* if (!(o_ptr->marked & OM_FOUND)) continue; */
- /* Check for chest */
- if (o_ptr->tval == TV_CHEST) return (this_o_idx);
+ /* Check for non empty chest */
+ if ((o_ptr->tval == TV_CHEST) &&
+ (((!trapped) && (o_ptr->pval)) || /* non empty */
+ ((trapped) && (o_ptr->pval > 0)))) /* trapped only */
+ {
+ return (this_o_idx);
+ }
}
/* No chest */
int xx = px + ddx_ddd[d];
/* No (visible) chest is there */
- if ((o_idx = chest_check(yy, xx)) == 0) continue;
+ if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
/* Grab the object */
o_ptr = &o_list[o_idx];
feat = get_feat_mimic(c_ptr);
/* Check for chest */
- o_idx = chest_check(y, x);
+ o_idx = chest_check(y, x, FALSE);
/* Nothing useful */
if (!have_flag(f_info[feat].flags, FF_OPEN) && !o_idx)
feat = get_feat_mimic(c_ptr);
/* Check for chests */
- o_idx = chest_check(y, x);
+ o_idx = chest_check(y, x, TRUE);
/* Disarm a trap */
if (!is_trap(feat) && !o_idx)
bool get_rep_dir(int *dp, bool under)
{
int dir;
+ cptr prompt;
/* Initialize */
(*dp) = 0;
#endif /* ALLOW_REPEAT -- TNB */
+ if (under)
+ {
+ prompt = _("Êý¸þ ('.'¸µ, ESC¤ÇÃæÃÇ)? ", "Direction ('.' at feet, Escape to cancel)? ");
+ }
+ else
+ {
+ prompt = _("Êý¸þ (ESC¤ÇÃæÃÇ)? ", "Direction (Escape to cancel)? ");
+ }
+
/* Get a direction */
while (!dir)
{
char ch;
/* Get a command (or Cancel) */
-#ifdef JP
-if (!get_com("Êý¸þ (ESC¤ÇÃæÃÇ)? ", &ch, TRUE)) break;
-#else
- if (!get_com("Direction (Escape to cancel)? ", &ch, TRUE)) break;
-#endif
+ if (!get_com(prompt, &ch, TRUE)) break;
+ /* Look down */
+ if ((under) && ((ch == '5') || (ch == '-') || (ch == '.')))
+ {
+ dir = 5;
+ }
+ else
+ {
+ /* Look up the direction */
+ dir = get_keymap_dir(ch);
- /* Look up the direction */
- dir = get_keymap_dir(ch);
-
- /* Oops */
- if (!dir) bell();
+ /* Oops */
+ if (!dir) bell();
+ }
}
/* Prevent weirdness */