Changeset 452
- Timestamp:
- 08/05/07 22:05:55 (1 year ago)
- Files:
-
- trunk/src/object2.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/object2.c
r449 r452 614 614 615 615 /* Allocate and wipe */ 616 obj_alloc = C_ZNEW( MAX_O_DEPTH* k_max, byte);616 obj_alloc = C_ZNEW((MAX_O_DEPTH + 1) * k_max, byte); 617 617 618 618 /* Wipe the totals */ 619 C_WIPE(obj_total, MAX_O_DEPTH , u32b);619 C_WIPE(obj_total, MAX_O_DEPTH + 1, u32b); 620 620 621 621 … … 632 632 633 633 /* Go through all the dungeon levels */ 634 for (lev = 0; lev < MAX_O_DEPTH; lev++)634 for (lev = 0; lev <= MAX_O_DEPTH; lev++) 635 635 { 636 636 int rarity = k_ptr->alloc_prob; … … 657 657 { 658 658 /* This is the base index into obj_alloc for this dlev */ 659 size_t ind = level * z_info->k_max; 660 661 size_t item; 659 size_t ind, item; 662 660 u32b value; 663 661 662 /* Occasional level boost */ 663 if ((level > 0) && !rand_int(GREAT_OBJ)) 664 { 665 /* What a bizarre calculation */ 666 level = 1 + (level * MAX_O_DEPTH / randint(MAX_O_DEPTH)); 667 } 664 668 665 669 /* Paranoia */ … … 667 671 level = MAX(level, 0); 668 672 669 670 673 /* Pick an object */ 674 ind = level * z_info->k_max; 671 675 value = rand_int(obj_total[level]); 672 676 for (item = 1; item < z_info->k_max; item++)
