Changeset 812
- Timestamp:
- 03/21/08 12:54:00 (7 months ago)
- Files:
-
- trunk/src/cave.c (modified) (2 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/xtra3.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cave.c
r808 r812 581 581 * Checks if a square is at the (inner) edge of a trap detect area 582 582 */ 583 staticbool dtrap_edge(int y, int x)583 bool dtrap_edge(int y, int x) 584 584 { 585 585 /* Check if the square is a dtrap in the first place */ … … 587 587 588 588 /* Check for non-dtrap adjacent grids */ 589 if (in_bounds (y + 1, x ) && (!cave_info2[y + 1][x ] & CAVE2_DTRAP)) return TRUE;590 if (in_bounds (y , x + 1) && (!cave_info2[y ][x + 1] & CAVE2_DTRAP)) return TRUE;591 if (in_bounds (y - 1, x ) && (!cave_info2[y - 1][x ] & CAVE2_DTRAP)) return TRUE;592 if (in_bounds (y , x - 1) && (!cave_info2[y ][x - 1] & CAVE2_DTRAP)) return TRUE;589 if (in_bounds_fully(y + 1, x ) && (!cave_info2[y + 1][x ] & CAVE2_DTRAP)) return TRUE; 590 if (in_bounds_fully(y , x + 1) && (!cave_info2[y ][x + 1] & CAVE2_DTRAP)) return TRUE; 591 if (in_bounds_fully(y - 1, x ) && (!cave_info2[y - 1][x ] & CAVE2_DTRAP)) return TRUE; 592 if (in_bounds_fully(y , x - 1) && (!cave_info2[y ][x - 1] & CAVE2_DTRAP)) return TRUE; 593 593 594 594 return FALSE; trunk/src/externs.h
r810 r812 310 310 extern void disturb(int stop_search, int unused_flag); 311 311 extern bool is_quest(int level); 312 extern bool dtrap_edge(int y, int x); 312 313 313 314 /* cmd1.c */ trunk/src/xtra3.c
r698 r812 832 832 if (info & (CAVE2_DTRAP)) 833 833 { 834 c_put_str(TERM_GREEN, "DTrap", row, col); 834 /* The player is on the border */ 835 if (dtrap_edge(p_ptr->py, p_ptr->px)) 836 c_put_str(TERM_YELLOW, "DTrap", row, col); 837 else 838 c_put_str(TERM_GREEN, "DTrap", row, col); 839 835 840 return 5; 836 841 }
