Changeset 603
- Timestamp:
- 09/29/07 19:46:12 (1 year ago)
- Files:
-
- trunk/src/cmd1.c (modified) (4 diffs)
- trunk/src/externs.h (modified) (1 diff)
- trunk/src/object1.c (modified) (5 diffs)
- trunk/src/squelch.c (modified) (1 diff)
- trunk/src/xtra2.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/cmd1.c
r589 r603 366 366 if (squelch_hide_item(o_ptr) || !o_ptr->k_idx) continue; 367 367 368 /* XXX Hack -- Enforce limit */ 369 if (floor_num >= N_ELEMENTS(floor_list)) break; 370 371 368 372 /* Hack -- disturb */ 369 373 disturb(0, 0); … … 392 396 if (inven_carry_okay(o_ptr)) 393 397 can_pickup++; 394 395 /* XXX Hack -- Enforce limit */396 if (floor_num == MAX_FLOOR_STACK) break;397 398 } 398 399 … … 438 439 439 440 /* Scan all marked objects in the grid */ 440 (void)scan_floor(floor_list, &floor_num, py, px, 0x03);441 floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), py, px, 0x03); 441 442 442 443 /* Save screen */ … … 480 481 { 481 482 /* Scan floor (again) */ 482 (void)scan_floor(floor_list, &floor_num, py, px, 0x03);483 floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), py, px, 0x03); 483 484 484 485 /* Use a menu interface for multiple objects, or pickup single objects */ trunk/src/externs.h
r595 r603 414 414 extern cptr describe_use(int i); 415 415 extern bool item_tester_okay(const object_type *o_ptr); 416 extern bool scan_floor(int *items, int *item_num, int y, int x, int mode);416 extern int scan_floor(int *items, int max_size, int y, int x, int mode); 417 417 extern void display_inven(void); 418 418 extern void display_equip(void); trunk/src/object1.c
r556 r603 1926 1926 * 0x04 -- Only the top item 1927 1927 */ 1928 bool scan_floor(int *items, int *item_num, int y, int x, int mode)1928 int scan_floor(int *items, int max_size, int y, int x, int mode) 1929 1929 { 1930 1930 int this_o_idx, next_o_idx; … … 1932 1932 int num = 0; 1933 1933 1934 (*item_num) = 0;1935 1936 1934 /* Sanity */ 1937 if (!in_bounds(y, x)) return (FALSE);1935 if (!in_bounds(y, x)) return 0; 1938 1936 1939 1937 /* Scan all objects in the grid */ … … 1941 1939 { 1942 1940 object_type *o_ptr; 1941 1942 /* XXX Hack -- Enforce limit */ 1943 if (num >= max_size) break; 1944 1943 1945 1944 1946 /* Get the object */ … … 1960 1962 /* Only one */ 1961 1963 if (mode & 0x04) break; 1962 1963 /* XXX Hack -- Enforce limit */ 1964 if (num == MAX_FLOOR_STACK) break; 1965 } 1966 1967 /* Number of items */ 1968 (*item_num) = num; 1969 1970 /* Result */ 1971 return (num != 0); 1964 } 1965 1966 return num; 1972 1967 } 1973 1968 … … 2803 2798 2804 2799 /* Scan all non-gold objects in the grid */ 2805 (void)scan_floor(floor_list, &floor_num, py, px, 0x01);2800 floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), py, px, 0x03); 2806 2801 2807 2802 /* Full floor */ trunk/src/squelch.c
r542 r603 474 474 /* Set the hook and scan the floor */ 475 475 item_tester_hook = squelch_item_ok; 476 (void)scan_floor(floor_list, &floor_num, p_ptr->py, p_ptr->px, 0x01);476 floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), p_ptr->py, p_ptr->px, 0x01); 477 477 478 478 if (floor_num) trunk/src/xtra2.c
r542 r603 2616 2616 floored = FALSE; 2617 2617 2618 floor_num = scan_floor(floor_list, N_ELEMENTS(floor_list), y, x, 0x02); 2619 2618 2620 /* Scan all marked objects in the grid */ 2619 if (( scan_floor(floor_list, &floor_num, y, x, 0x02)) &&2621 if ((floor_num > 0) && 2620 2622 (!(p_ptr->timed[TMD_BLIND]) || (y == p_ptr->py && x == p_ptr->px))) 2621 2623 {
