• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisionb138823cd6c5891a1c8ea857c34503f59131c163 (tree)
Time2019-02-27 14:01:47
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38993 o_list と max_o_idx を floor_type に取り込む。 / Move o_list and max_o_idx to floor_type structure.

Change Summary

Incremental Difference

--- a/doxygen/Hengband.doxyfile
+++ b/doxygen/Hengband.doxyfile
@@ -2220,7 +2220,7 @@ MSCGEN_PATH =
22202220 # DIA_PATH tag allows you to specify the directory where the dia binary resides.
22212221 # If left empty dia is assumed to be found in the default search path.
22222222
2223-DIA_PATH =
2223+DIA_PATH = "../../../../../../Program Files (x86)/Graphviz2.38/bin"
22242224
22252225 # If set to YES the inheritance and collaboration graphs will hide inheritance
22262226 # and usage relations if the target is undocumented or is not a class.
--- a/src/autopick.c
+++ b/src/autopick.c
@@ -1616,7 +1616,7 @@ static void autopick_delayed_alter_aux(INVENTORY_IDX item)
16161616 if (item >= 0) o_ptr = &inventory[item];
16171617
16181618 /* Get the item (on the floor) */
1619- else o_ptr = &o_list[0 - item];
1619+ else o_ptr = &current_floor_ptr->o_list[0 - item];
16201620
16211621 if (o_ptr->k_idx && (o_ptr->marked & OM_AUTODESTROY))
16221622 {
@@ -1661,7 +1661,7 @@ void autopick_delayed_alter(void)
16611661 item = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx;
16621662 while (item)
16631663 {
1664- OBJECT_IDX next = o_list[item].next_o_idx;
1664+ OBJECT_IDX next = current_floor_ptr->o_list[item].next_o_idx;
16651665 autopick_delayed_alter_aux(-item);
16661666 item = next;
16671667 }
@@ -1683,7 +1683,7 @@ void autopick_alter_item(INVENTORY_IDX item, bool destroy)
16831683 if (item >= 0) o_ptr = &inventory[item];
16841684
16851685 /* Get the item (on the floor) */
1686- else o_ptr = &o_list[0 - item];
1686+ else o_ptr = &current_floor_ptr->o_list[0 - item];
16871687
16881688 /* Get the index in the auto-pick/destroy list */
16891689 idx = is_autopick(o_ptr);
@@ -1708,7 +1708,7 @@ void autopick_pickup_items(grid_type *g_ptr)
17081708 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
17091709 {
17101710 int idx;
1711- object_type *o_ptr = &o_list[this_o_idx];
1711+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
17121712
17131713 /* Acquire next object */
17141714 next_o_idx = o_ptr->next_o_idx;
--- a/src/chest.c
+++ b/src/chest.c
@@ -31,7 +31,7 @@ void chest_death(bool scatter, POSITION y, POSITION x, OBJECT_IDX o_idx)
3131 object_type forge;
3232 object_type *q_ptr;
3333
34- object_type *o_ptr = &o_list[o_idx];
34+ object_type *o_ptr = &current_floor_ptr->o_list[o_idx];
3535
3636
3737 /* Small chests often hold "gold" */
@@ -134,7 +134,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
134134 {
135135 int i, trap;
136136
137- object_type *o_ptr = &o_list[o_idx];
137+ object_type *o_ptr = &current_floor_ptr->o_list[o_idx];
138138
139139 int mon_level = o_ptr->xtra3;
140140
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -364,7 +364,7 @@ void do_cmd_activate_aux(INVENTORY_IDX item)
364364 /* Get the item (on the floor) */
365365 else
366366 {
367- o_ptr = &o_list[0 - item];
367+ o_ptr = &current_floor_ptr->o_list[0 - item];
368368 }
369369
370370 take_turn(p_ptr, 100);
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -36,7 +36,7 @@ void do_cmd_eat_food_aux(INVENTORY_IDX item)
3636 /* Get the item (on the floor) */
3737 else
3838 {
39- o_ptr = &o_list[0 - item];
39+ o_ptr = &current_floor_ptr->o_list[0 - item];
4040 }
4141
4242 sound(SOUND_EAT);
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -54,7 +54,7 @@ void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
5454 /* Get the item (on the floor) */
5555 else
5656 {
57- o_ptr = &o_list[0 - item];
57+ o_ptr = &current_floor_ptr->o_list[0 - item];
5858 }
5959 q_ptr = &forge;
6060
--- a/src/cmd-read.c
+++ b/src/cmd-read.c
@@ -46,7 +46,7 @@ void do_cmd_read_scroll_aux(INVENTORY_IDX item, bool known)
4646 /* Get the item (on the floor) */
4747 else
4848 {
49- o_ptr = &o_list[0 - item];
49+ o_ptr = &current_floor_ptr->o_list[0 - item];
5050 }
5151
5252 take_turn(p_ptr, 100);
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -288,7 +288,7 @@ void do_cmd_use_staff_aux(INVENTORY_IDX item)
288288 /* Get the item (on the floor) */
289289 else
290290 {
291- o_ptr = &o_list[0 - item];
291+ o_ptr = &current_floor_ptr->o_list[0 - item];
292292 }
293293
294294
--- a/src/cmd-zaprod.c
+++ b/src/cmd-zaprod.c
@@ -277,7 +277,7 @@ void do_cmd_zap_rod_aux(INVENTORY_IDX item)
277277 /* Get the item (on the floor) */
278278 else
279279 {
280- o_ptr = &o_list[0 - item];
280+ o_ptr = &current_floor_ptr->o_list[0 - item];
281281 }
282282
283283
--- a/src/cmd-zapwand.c
+++ b/src/cmd-zapwand.c
@@ -333,7 +333,7 @@ void do_cmd_aim_wand_aux(INVENTORY_IDX item)
333333 /* Get the item (on the floor) */
334334 else
335335 {
336- o_ptr = &o_list[0 - item];
336+ o_ptr = &current_floor_ptr->o_list[0 - item];
337337 }
338338
339339 /* Mega-Hack -- refuse to aim a pile from the ground */
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -489,7 +489,7 @@ static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
489489 {
490490 object_type *o_ptr;
491491
492- o_ptr = &o_list[this_o_idx];
492+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
493493 next_o_idx = o_ptr->next_o_idx;
494494
495495 /* Skip unknown chests XXX XXX */
@@ -521,7 +521,7 @@ static bool do_cmd_open_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
521521 int i, j;
522522 bool flag = TRUE;
523523 bool more = FALSE;
524- object_type *o_ptr = &o_list[o_idx];
524+ object_type *o_ptr = &current_floor_ptr->o_list[o_idx];
525525
526526 take_turn(p_ptr, 100);
527527
@@ -664,7 +664,7 @@ static int count_chests(POSITION *y, POSITION *x, bool trapped)
664664 if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
665665
666666 /* Grab the object */
667- o_ptr = &o_list[o_idx];
667+ o_ptr = &current_floor_ptr->o_list[o_idx];
668668
669669 /* Already open */
670670 if (o_ptr->pval == 0) continue;
@@ -1368,7 +1368,7 @@ static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
13681368 {
13691369 int i, j;
13701370 bool more = FALSE;
1371- object_type *o_ptr = &o_list[o_idx];
1371+ object_type *o_ptr = &current_floor_ptr->o_list[o_idx];
13721372
13731373 take_turn(p_ptr, 100);
13741374
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -5282,7 +5282,7 @@ static void do_cmd_knowledge_artifacts(void)
52825282 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
52835283 {
52845284 object_type *o_ptr;
5285- o_ptr = &o_list[this_o_idx];
5285+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
52865286
52875287 /* Acquire next object */
52885288 next_o_idx = o_ptr->next_o_idx;
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -2953,7 +2953,7 @@ static void process_world_aux_recharge(void)
29532953 /* Process objects on floor */
29542954 for (i = 1; i < o_max; i++)
29552955 {
2956- object_type *o_ptr = &o_list[i];
2956+ object_type *o_ptr = &current_floor_ptr->o_list[i];
29572957
29582958 /* Skip dead objects */
29592959 if (!o_ptr->k_idx) continue;
@@ -3242,7 +3242,7 @@ static byte get_dungeon_feeling(void)
32423242 /* Examine each unidentified object */
32433243 for (i = 1; i < o_max; i++)
32443244 {
3245- object_type *o_ptr = &o_list[i];
3245+ object_type *o_ptr = &current_floor_ptr->o_list[i];
32463246 object_kind *k_ptr = &k_info[o_ptr->k_idx];
32473247 int delta = 0;
32483248
@@ -5446,7 +5446,7 @@ static void dungeon(bool load_game)
54465446
54475447
54485448 /* Hack -- Compact the object list occasionally */
5449- if (o_cnt + 32 > max_o_idx) compact_objects(64);
5449+ if (o_cnt + 32 > current_floor_ptr->max_o_idx) compact_objects(64);
54505450
54515451 /* Hack -- Compress the object list occasionally */
54525452 if (o_cnt + 32 < o_max) compact_objects(0);
--- a/src/externs.h
+++ b/src/externs.h
@@ -340,7 +340,6 @@ extern FEAT_IDX max_f_idx;
340340 extern ARTIFACT_IDX max_a_idx;
341341 extern EGO_IDX max_e_idx;
342342 extern DUNGEON_IDX max_d_idx;
343-extern OBJECT_IDX max_o_idx;
344343 extern MONSTER_IDX max_m_idx;
345344 extern POSITION max_wild_x;
346345 extern POSITION max_wild_y;
--- a/src/floor-generate.c
+++ b/src/floor-generate.c
@@ -1313,7 +1313,7 @@ void clear_cave(void)
13131313 int i;
13141314
13151315 /* Very simplified version of wipe_o_list() */
1316- (void)C_WIPE(o_list, o_max, object_type);
1316+ (void)C_WIPE(current_floor_ptr->o_list, o_max, object_type);
13171317 o_max = 1;
13181318 o_cnt = 0;
13191319
@@ -1418,7 +1418,7 @@ void generate_random_floor(void)
14181418
14191419
14201420 /* Prevent object over-flow */
1421- if (o_max >= max_o_idx)
1421+ if (o_max >= current_floor_ptr->max_o_idx)
14221422 {
14231423 why = _("アイテムが多すぎる", "too many objects");
14241424 okay = FALSE;
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -653,7 +653,7 @@ static void update_unique_artifact(s16b cur_floor_id)
653653 /* Maintain artifatcs */
654654 for (i = 1; i < o_max; i++)
655655 {
656- object_type *o_ptr = &o_list[i];
656+ object_type *o_ptr = &current_floor_ptr->o_list[i];
657657
658658 /* Skip dead objects */
659659 if (!o_ptr->k_idx) continue;
@@ -1238,7 +1238,7 @@ void change_floor(void)
12381238 /* Maintain artifatcs */
12391239 for (i = 1; i < o_max; i++)
12401240 {
1241- object_type *o_ptr = &o_list[i];
1241+ object_type *o_ptr = &current_floor_ptr->o_list[i];
12421242
12431243 /* Skip dead objects */
12441244 if (!o_ptr->k_idx) continue;
--- a/src/floor-streams.c
+++ b/src/floor-streams.c
@@ -294,7 +294,7 @@ void build_streamer(IDX feat, int chance)
294294 /* Scan all objects in the grid */
295295 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
296296 {
297- object_type *o_ptr = &o_list[this_o_idx];
297+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
298298
299299 /* Acquire next object */
300300 next_o_idx = o_ptr->next_o_idx;
--- a/src/grid.c
+++ b/src/grid.c
@@ -1375,7 +1375,7 @@ bool cave_valid_bold(POSITION y, POSITION x)
13751375 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
13761376 {
13771377 object_type *o_ptr;
1378- o_ptr = &o_list[this_o_idx];
1378+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
13791379
13801380 /* Acquire next object */
13811381 next_o_idx = o_ptr->next_o_idx;
@@ -1942,7 +1942,7 @@ void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLO
19421942 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
19431943 {
19441944 object_type *o_ptr;
1945- o_ptr = &o_list[this_o_idx];
1945+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
19461946
19471947 /* Acquire next object */
19481948 next_o_idx = o_ptr->next_o_idx;
@@ -2230,7 +2230,7 @@ void note_spot(POSITION y, POSITION x)
22302230 /* Hack -- memorize objects */
22312231 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
22322232 {
2233- object_type *o_ptr = &o_list[this_o_idx];
2233+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
22342234
22352235 /* Acquire next object */
22362236 next_o_idx = o_ptr->next_o_idx;
--- a/src/init1.c
+++ b/src/init1.c
@@ -3907,7 +3907,7 @@ static void drop_here(object_type *j_ptr, POSITION y, POSITION x)
39073907 OBJECT_IDX o_idx = o_pop();
39083908
39093909 /* Access new object */
3910- o_ptr = &o_list[o_idx];
3910+ o_ptr = &current_floor_ptr->o_list[o_idx];
39113911
39123912 /* Structure copy */
39133913 object_copy(o_ptr, j_ptr);
@@ -4377,7 +4377,7 @@ static errr process_dungeon_file_aux(char *buf, int ymin, int xmin, int ymax, in
43774377 /* Maximum o_idx */
43784378 else if (zz[0][0] == 'O')
43794379 {
4380- max_o_idx = (IDX)atoi(zz[1]);
4380+ current_floor_ptr->max_o_idx = (IDX)atoi(zz[1]);
43814381 }
43824382
43834383 /* Maximum m_idx */
--- a/src/init2.c
+++ b/src/init2.c
@@ -1221,7 +1221,7 @@ static errr init_other(void)
12211221 /*** Prepare the "dungeon" information ***/
12221222
12231223 /* Allocate and Wipe the object list */
1224- C_MAKE(o_list, max_o_idx, object_type);
1224+ C_MAKE(current_floor_ptr->o_list, current_floor_ptr->max_o_idx, object_type);
12251225
12261226 /* Allocate and Wipe the monster list */
12271227 C_MAKE(m_list, max_m_idx, monster_type);
--- a/src/load.c
+++ b/src/load.c
@@ -2835,7 +2835,7 @@ static errr rd_dungeon_old(void)
28352835 rd_u16b(&limit);
28362836
28372837 /* Verify maximum */
2838- if (limit > max_o_idx)
2838+ if (limit > current_floor_ptr->max_o_idx)
28392839 {
28402840 note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
28412841 return (151);
@@ -2860,7 +2860,7 @@ static errr rd_dungeon_old(void)
28602860
28612861
28622862 /* Acquire place */
2863- o_ptr = &o_list[o_idx];
2863+ o_ptr = &current_floor_ptr->o_list[o_idx];
28642864
28652865 /* Read the item */
28662866 rd_item(o_ptr);
@@ -3164,7 +3164,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
31643164 rd_u16b(&limit);
31653165
31663166 /* Verify maximum */
3167- if (limit > max_o_idx) return 151;
3167+ if (limit > current_floor_ptr->max_o_idx) return 151;
31683168
31693169
31703170 /* Read the dungeon items */
@@ -3180,7 +3180,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
31803180 if (i != o_idx) return 152;
31813181
31823182 /* Acquire place */
3183- o_ptr = &o_list[o_idx];
3183+ o_ptr = &current_floor_ptr->o_list[o_idx];
31843184
31853185 /* Read the item */
31863186 rd_item(o_ptr);
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -1167,7 +1167,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
11671167
11681168 if (target_ptr->hold_o_idx)
11691169 {
1170- object_type *q_ptr = &o_list[target_ptr->hold_o_idx];
1170+ object_type *q_ptr = &current_floor_ptr->o_list[target_ptr->hold_o_idx];
11711171 GAME_TEXT o_name[MAX_NLEN];
11721172
11731173 object_desc(o_name, q_ptr, OD_NAME_ONLY);
@@ -2187,7 +2187,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
21872187 if (o_idx)
21882188 {
21892189 object_type *j_ptr;
2190- j_ptr = &o_list[o_idx];
2190+ j_ptr = &current_floor_ptr->o_list[o_idx];
21912191 object_copy(j_ptr, o_ptr);
21922192
21932193 /* Modify number */
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -3073,7 +3073,7 @@ void process_monster(MONSTER_IDX m_idx)
30733073 {
30743074 BIT_FLAGS flgs[TR_FLAG_SIZE], flg2 = 0L, flg3 = 0L, flgr = 0L;
30753075 GAME_TEXT m_name[MAX_NLEN], o_name[MAX_NLEN];
3076- object_type *o_ptr = &o_list[this_o_idx];
3076+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
30773077
30783078 /* Acquire next object */
30793079 next_o_idx = o_ptr->next_o_idx;
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -272,7 +272,7 @@ void delete_monster_idx(MONSTER_IDX i)
272272 for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
273273 {
274274 object_type *o_ptr;
275- o_ptr = &o_list[this_o_idx];
275+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
276276
277277 /* Acquire next object */
278278 next_o_idx = o_ptr->next_o_idx;
@@ -358,7 +358,7 @@ static void compact_monsters_aux(IDX i1, IDX i2)
358358 for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
359359 {
360360 object_type *o_ptr;
361- o_ptr = &o_list[this_o_idx];
361+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
362362
363363 /* Acquire next object */
364364 next_o_idx = o_ptr->next_o_idx;
@@ -4477,7 +4477,7 @@ void monster_drop_carried_objects(monster_type *m_ptr)
44774477 /* Drop objects being carried */
44784478 for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
44794479 {
4480- o_ptr = &o_list[this_o_idx];
4480+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
44814481
44824482 /* Acquire next object */
44834483 next_o_idx = o_ptr->next_o_idx;
--- a/src/mspells1.c
+++ b/src/mspells1.c
@@ -418,7 +418,7 @@ bool raise_possible(monster_type *m_ptr)
418418 /* Scan the pile of objects */
419419 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
420420 {
421- object_type *o_ptr = &o_list[this_o_idx];
421+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
422422
423423 /* Acquire next object */
424424 next_o_idx = o_ptr->next_o_idx;
--- a/src/object1.c
+++ b/src/object1.c
@@ -1952,7 +1952,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
19521952 /* Check every object in the grid */
19531953 for (i = 0; i < floor_num && i < 23; i++)
19541954 {
1955- object_type *o_ptr = &o_list[floor_list[i]];
1955+ object_type *o_ptr = &current_floor_ptr->o_list[floor_list[i]];
19561956
19571957 /* Skip empty inscriptions */
19581958 if (!o_ptr->inscription) continue;
@@ -1991,7 +1991,7 @@ static bool get_tag_floor(COMMAND_CODE *cp, char tag, FLOOR_IDX floor_list[], IT
19911991 /* Check every object in the grid */
19921992 for (i = 0; i < floor_num && i < 23; i++)
19931993 {
1994- object_type *o_ptr = &o_list[floor_list[i]];
1994+ object_type *o_ptr = &current_floor_ptr->o_list[floor_list[i]];
19951995
19961996 /* Skip empty inscriptions */
19971997 if (!o_ptr->inscription) continue;
@@ -2507,7 +2507,7 @@ static bool verify(concptr prompt, INVENTORY_IDX item)
25072507 /* Floor */
25082508 else
25092509 {
2510- o_ptr = &o_list[0 - item];
2510+ o_ptr = &current_floor_ptr->o_list[0 - item];
25112511 }
25122512 object_desc(o_name, o_ptr, 0);
25132513
@@ -2541,7 +2541,7 @@ static bool get_item_allow(INVENTORY_IDX item)
25412541 /* Floor */
25422542 else
25432543 {
2544- o_ptr = &o_list[0 - item];
2544+ o_ptr = &current_floor_ptr->o_list[0 - item];
25452545 }
25462546
25472547 /* No inscription */
@@ -2726,7 +2726,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
27262726
27272727 /* Special index */
27282728 k = 0 - (*cp);
2729- o_ptr = &o_list[k];
2729+ o_ptr = &current_floor_ptr->o_list[k];
27302730
27312731 /* Validate the item */
27322732 if (item_tester_okay(o_ptr) || (mode & USE_FULL))
@@ -2842,7 +2842,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
28422842 for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
28432843 {
28442844 object_type *o_ptr;
2845- o_ptr = &o_list[this_o_idx];
2845+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
28462846
28472847 /* Acquire next object */
28482848 next_o_idx = o_ptr->next_o_idx;
@@ -3192,7 +3192,7 @@ bool get_item(OBJECT_IDX *cp, concptr pmt, concptr str, BIT_FLAGS mode)
31923192 for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
31933193 {
31943194 object_type *o_ptr;
3195- o_ptr = &o_list[this_o_idx];
3195+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
31963196
31973197 /* Acquire next object */
31983198 next_o_idx = o_ptr->next_o_idx;
@@ -3454,7 +3454,7 @@ object_type *choose_object(OBJECT_IDX *idx, concptr q, concptr s, BIT_FLAGS opti
34543454 else if (item >= 0) return &inventory[item];
34553455
34563456 /* Get the item (on the floor) */
3457- else return &o_list[0 - item];
3457+ else return &current_floor_ptr->o_list[0 - item];
34583458 }
34593459
34603460
@@ -3486,7 +3486,7 @@ ITEM_NUMBER scan_floor(OBJECT_IDX *items, POSITION y, POSITION x, BIT_FLAGS mode
34863486 for (this_o_idx = current_floor_ptr->grid_array[y][x].o_idx; this_o_idx; this_o_idx = next_o_idx)
34873487 {
34883488 object_type *o_ptr;
3489- o_ptr = &o_list[this_o_idx];
3489+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
34903490
34913491 /* Acquire next object */
34923492 next_o_idx = o_ptr->next_o_idx;
@@ -3554,7 +3554,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
35543554 /* Display the floor objects */
35553555 for (k = 0, i = 0; i < floor_num && i < 23; i++)
35563556 {
3557- o_ptr = &o_list[floor_list[i]];
3557+ o_ptr = &current_floor_ptr->o_list[floor_list[i]];
35583558
35593559 object_desc(o_name, o_ptr, 0);
35603560
@@ -3598,7 +3598,7 @@ COMMAND_CODE show_floor(int target_item, POSITION y, POSITION x, TERM_LEN *min_w
35983598 /* Get the index */
35993599 m = floor_list[out_index[j]];
36003600
3601- o_ptr = &o_list[m];
3601+ o_ptr = &current_floor_ptr->o_list[m];
36023602
36033603 /* Clear the line */
36043604 prt("", j + 1, col ? col - 2 : col);
@@ -3732,7 +3732,7 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
37323732 }
37333733
37343734 /* Validate the item */
3735- else if (item_tester_okay(&o_list[0 - (*cp)]) || (mode & USE_FULL))
3735+ else if (item_tester_okay(&current_floor_ptr->o_list[0 - (*cp)]) || (mode & USE_FULL))
37363736 {
37373737 /* Forget restrictions */
37383738 item_tester_tval = 0;
@@ -4377,18 +4377,18 @@ bool get_item_floor(COMMAND_CODE *cp, concptr pmt, concptr str, BIT_FLAGS mode)
43774377 o_idx = g_ptr->o_idx;
43784378
43794379 /* Only rotate a pile of two or more objects. */
4380- if (!(o_idx && o_list[o_idx].next_o_idx)) break;
4380+ if (!(o_idx && current_floor_ptr->o_list[o_idx].next_o_idx)) break;
43814381
43824382 /* Remove the first object from the list. */
43834383 excise_object_idx(o_idx);
43844384
43854385 /* Find end of the list. */
43864386 i = g_ptr->o_idx;
4387- while (o_list[i].next_o_idx)
4388- i = o_list[i].next_o_idx;
4387+ while (current_floor_ptr->o_list[i].next_o_idx)
4388+ i = current_floor_ptr->o_list[i].next_o_idx;
43894389
43904390 /* Add after the last object. */
4391- o_list[i].next_o_idx = o_idx;
4391+ current_floor_ptr->o_list[i].next_o_idx = o_idx;
43924392
43934393 /* Re-scan floor list */
43944394 floor_num = scan_floor(floor_list, p_ptr->y, p_ptr->x, 0x03);
@@ -4846,7 +4846,7 @@ void py_pickup_floor(bool pickup)
48464846 for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
48474847 {
48484848 /* Access the object */
4849- o_ptr = &o_list[this_o_idx];
4849+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
48504850
48514851 object_desc(o_name, o_ptr, 0);
48524852
@@ -4913,7 +4913,7 @@ void py_pickup_floor(bool pickup)
49134913 if (floor_num == 1)
49144914 {
49154915 /* Access the object */
4916- o_ptr = &o_list[floor_o_idx];
4916+ o_ptr = &current_floor_ptr->o_list[floor_o_idx];
49174917
49184918 #ifdef ALLOW_EASY_SENSE
49194919
@@ -4947,7 +4947,7 @@ void py_pickup_floor(bool pickup)
49474947 if (floor_num == 1)
49484948 {
49494949 /* Access the object */
4950- o_ptr = &o_list[floor_o_idx];
4950+ o_ptr = &current_floor_ptr->o_list[floor_o_idx];
49514951
49524952 #ifdef ALLOW_EASY_SENSE
49534953
@@ -4984,7 +4984,7 @@ void py_pickup_floor(bool pickup)
49844984 char out_val[MAX_NLEN+20];
49854985
49864986 /* Access the object */
4987- o_ptr = &o_list[floor_o_idx];
4987+ o_ptr = &current_floor_ptr->o_list[floor_o_idx];
49884988
49894989 #ifdef ALLOW_EASY_SENSE
49904990
@@ -5010,7 +5010,7 @@ void py_pickup_floor(bool pickup)
50105010 }
50115011
50125012 /* Access the object */
5013- o_ptr = &o_list[floor_o_idx];
5013+ o_ptr = &current_floor_ptr->o_list[floor_o_idx];
50145014
50155015 #ifdef ALLOW_EASY_SENSE
50165016
--- a/src/object2.c
+++ b/src/object2.c
@@ -70,7 +70,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
7070 OBJECT_IDX prev_o_idx = 0;
7171
7272 /* Object */
73- j_ptr = &o_list[o_idx];
73+ j_ptr = &current_floor_ptr->o_list[o_idx];
7474
7575 /* Monster */
7676 if (j_ptr->held_m_idx)
@@ -84,7 +84,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
8484 for (this_o_idx = m_ptr->hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
8585 {
8686 object_type *o_ptr;
87- o_ptr = &o_list[this_o_idx];
87+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
8888
8989 /* Acquire next object */
9090 next_o_idx = o_ptr->next_o_idx;
@@ -104,7 +104,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
104104 object_type *k_ptr;
105105
106106 /* Previous object */
107- k_ptr = &o_list[prev_o_idx];
107+ k_ptr = &current_floor_ptr->o_list[prev_o_idx];
108108
109109 /* Remove from list */
110110 k_ptr->next_o_idx = next_o_idx;
@@ -135,7 +135,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
135135 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
136136 {
137137 object_type *o_ptr;
138- o_ptr = &o_list[this_o_idx];
138+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
139139
140140 /* Acquire next object */
141141 next_o_idx = o_ptr->next_o_idx;
@@ -155,7 +155,7 @@ void excise_object_idx(OBJECT_IDX o_idx)
155155 object_type *k_ptr;
156156
157157 /* Previous object */
158- k_ptr = &o_list[prev_o_idx];
158+ k_ptr = &current_floor_ptr->o_list[prev_o_idx];
159159
160160 /* Remove from list */
161161 k_ptr->next_o_idx = next_o_idx;
@@ -189,7 +189,7 @@ void delete_object_idx(OBJECT_IDX o_idx)
189189 excise_object_idx(o_idx);
190190
191191 /* Object */
192- j_ptr = &o_list[o_idx];
192+ j_ptr = &current_floor_ptr->o_list[o_idx];
193193
194194 /* Dungeon floor */
195195 if (!(j_ptr->held_m_idx))
@@ -230,7 +230,7 @@ void delete_object(POSITION y, POSITION x)
230230 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
231231 {
232232 object_type *o_ptr;
233- o_ptr = &o_list[this_o_idx];
233+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
234234
235235 /* Acquire next object */
236236 next_o_idx = o_ptr->next_o_idx;
@@ -267,7 +267,7 @@ static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
267267 /* Repair objects */
268268 for (i = 1; i < o_max; i++)
269269 {
270- o_ptr = &o_list[i];
270+ o_ptr = &current_floor_ptr->o_list[i];
271271
272272 /* Skip "dead" objects */
273273 if (!o_ptr->k_idx) continue;
@@ -279,7 +279,7 @@ static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
279279 o_ptr->next_o_idx = i2;
280280 }
281281 }
282- o_ptr = &o_list[i1];
282+ o_ptr = &current_floor_ptr->o_list[i1];
283283
284284 /* Monster */
285285 if (o_ptr->held_m_idx)
@@ -318,7 +318,7 @@ static void compact_objects_aux(OBJECT_IDX i1, OBJECT_IDX i2)
318318 }
319319
320320 /* Structure copy */
321- o_list[i2] = o_list[i1];
321+ current_floor_ptr->o_list[i2] = current_floor_ptr->o_list[i1];
322322
323323 /* Wipe the hole */
324324 object_wipe(o_ptr);
@@ -370,7 +370,7 @@ void compact_objects(int size)
370370 /* Examine the objects */
371371 for (i = 1; i < o_max; i++)
372372 {
373- o_ptr = &o_list[i];
373+ o_ptr = &current_floor_ptr->o_list[i];
374374
375375 /* Skip dead objects */
376376 if (!o_ptr->k_idx) continue;
@@ -424,7 +424,7 @@ void compact_objects(int size)
424424 /* Excise dead objects (backwards!) */
425425 for (i = o_max - 1; i >= 1; i--)
426426 {
427- o_ptr = &o_list[i];
427+ o_ptr = &current_floor_ptr->o_list[i];
428428
429429 /* Skip real objects */
430430 if (o_ptr->k_idx) continue;
@@ -457,7 +457,7 @@ void wipe_o_list(void)
457457 /* Delete the existing objects */
458458 for (i = 1; i < o_max; i++)
459459 {
460- object_type *o_ptr = &o_list[i];
460+ object_type *o_ptr = &current_floor_ptr->o_list[i];
461461
462462 /* Skip dead objects */
463463 if (!o_ptr->k_idx) continue;
@@ -524,7 +524,7 @@ OBJECT_IDX o_pop(void)
524524 OBJECT_IDX i;
525525
526526 /* Initial allocation */
527- if (o_max < max_o_idx)
527+ if (o_max < current_floor_ptr->max_o_idx)
528528 {
529529 /* Get next space */
530530 i = o_max;
@@ -544,7 +544,7 @@ OBJECT_IDX o_pop(void)
544544 for (i = 1; i < o_max; i++)
545545 {
546546 object_type *o_ptr;
547- o_ptr = &o_list[i];
547+ o_ptr = &current_floor_ptr->o_list[i];
548548
549549 /* Skip live objects */
550550 if (o_ptr->k_idx) continue;
@@ -4757,7 +4757,7 @@ void place_object(POSITION y, POSITION x, BIT_FLAGS mode)
47574757 if (o_idx)
47584758 {
47594759 object_type *o_ptr;
4760- o_ptr = &o_list[o_idx];
4760+ o_ptr = &current_floor_ptr->o_list[o_idx];
47614761
47624762 /* Structure Copy */
47634763 object_copy(o_ptr, q_ptr);
@@ -4870,7 +4870,7 @@ void place_gold(POSITION y, POSITION x)
48704870 if (o_idx)
48714871 {
48724872 object_type *o_ptr;
4873- o_ptr = &o_list[o_idx];
4873+ o_ptr = &current_floor_ptr->o_list[o_idx];
48744874
48754875 /* Copy the object */
48764876 object_copy(o_ptr, q_ptr);
@@ -5004,7 +5004,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
50045004 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
50055005 {
50065006 object_type *o_ptr;
5007- o_ptr = &o_list[this_o_idx];
5007+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
50085008
50095009 /* Acquire next object */
50105010 next_o_idx = o_ptr->next_o_idx;
@@ -5155,7 +5155,7 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
51555155 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
51565156 {
51575157 object_type *o_ptr;
5158- o_ptr = &o_list[this_o_idx];
5158+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
51595159
51605160 /* Acquire next object */
51615161 next_o_idx = o_ptr->next_o_idx;
@@ -5200,10 +5200,10 @@ OBJECT_IDX drop_near(object_type *j_ptr, PERCENTAGE chance, POSITION y, POSITION
52005200 if (!done)
52015201 {
52025202 /* Structure copy */
5203- object_copy(&o_list[o_idx], j_ptr);
5203+ object_copy(&current_floor_ptr->o_list[o_idx], j_ptr);
52045204
52055205 /* Access new object */
5206- j_ptr = &o_list[o_idx];
5206+ j_ptr = &current_floor_ptr->o_list[o_idx];
52075207
52085208 /* Locate */
52095209 j_ptr->iy = by;
@@ -5426,7 +5426,7 @@ void inven_item_optimize(INVENTORY_IDX item)
54265426 */
54275427 void floor_item_charges(INVENTORY_IDX item)
54285428 {
5429- object_type *o_ptr = &o_list[item];
5429+ object_type *o_ptr = &current_floor_ptr->o_list[item];
54305430
54315431 /* Require staff/wand */
54325432 if ((o_ptr->tval != TV_STAFF) && (o_ptr->tval != TV_WAND)) return;
@@ -5467,7 +5467,7 @@ void floor_item_charges(INVENTORY_IDX item)
54675467 */
54685468 void floor_item_describe(INVENTORY_IDX item)
54695469 {
5470- object_type *o_ptr = &o_list[item];
5470+ object_type *o_ptr = &current_floor_ptr->o_list[item];
54715471 GAME_TEXT o_name[MAX_NLEN];
54725472
54735473 object_desc(o_name, o_ptr, 0);
@@ -5498,7 +5498,7 @@ void floor_item_describe(INVENTORY_IDX item)
54985498 */
54995499 void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
55005500 {
5501- object_type *o_ptr = &o_list[item];
5501+ object_type *o_ptr = &current_floor_ptr->o_list[item];
55025502
55035503 /* Apply */
55045504 num += o_ptr->number;
@@ -5523,7 +5523,7 @@ void floor_item_increase(INVENTORY_IDX item, ITEM_NUMBER num)
55235523 */
55245524 void floor_item_optimize(INVENTORY_IDX item)
55255525 {
5526- object_type *o_ptr = &o_list[item];
5526+ object_type *o_ptr = &current_floor_ptr->o_list[item];
55275527
55285528 /* Paranoia -- be sure it exists */
55295529 if (!o_ptr->k_idx) return;
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -392,7 +392,7 @@ static void discover_hidden_things(POSITION y, POSITION x)
392392 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
393393 {
394394 object_type *o_ptr;
395- o_ptr = &o_list[this_o_idx];
395+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
396396
397397 /* Acquire next object */
398398 next_o_idx = o_ptr->next_o_idx;
@@ -474,7 +474,7 @@ void py_pickup_aux(OBJECT_IDX o_idx)
474474
475475 object_type *o_ptr;
476476
477- o_ptr = &o_list[o_idx];
477+ o_ptr = &current_floor_ptr->o_list[o_idx];
478478
479479 #ifdef JP
480480 object_desc(old_name, o_ptr, OD_NAME_ONLY);
@@ -575,7 +575,7 @@ void carry(bool pickup)
575575 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
576576 {
577577 object_type *o_ptr;
578- o_ptr = &o_list[this_o_idx];
578+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
579579
580580 #ifdef ALLOW_EASY_SENSE /* TNB */
581581
@@ -1802,7 +1802,7 @@ static bool run_test(void)
18021802 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
18031803 {
18041804 object_type *o_ptr;
1805- o_ptr = &o_list[this_o_idx];
1805+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
18061806
18071807 /* Acquire next object */
18081808 next_o_idx = o_ptr->next_o_idx;
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -2646,7 +2646,7 @@ void calc_bonuses(void)
26462646
26472647 for (this_o_idx = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx)
26482648 {
2649- o_ptr = &o_list[this_o_idx];
2649+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
26502650
26512651 /* Acquire next object */
26522652 next_o_idx = o_ptr->next_o_idx;
@@ -3809,7 +3809,7 @@ bool player_has_no_spellbooks(void)
38093809
38103810 for (i = current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].o_idx; i; i = o_ptr->next_o_idx)
38113811 {
3812- o_ptr = &o_list[i];
3812+ o_ptr = &current_floor_ptr->o_list[i];
38133813 if (o_ptr->k_idx && (o_ptr->marked & OM_FOUND) && check_book_realm(o_ptr->tval, o_ptr->sval)) return FALSE;
38143814 }
38153815
--- a/src/save.c
+++ b/src/save.c
@@ -1119,7 +1119,7 @@ static void wr_saved_floor(saved_floor_type *sf_ptr)
11191119 /* Dump the objects */
11201120 for (i = 1; i < o_max; i++)
11211121 {
1122- object_type *o_ptr = &o_list[i];
1122+ object_type *o_ptr = &current_floor_ptr->o_list[i];
11231123
11241124 /* Dump it */
11251125 wr_item(o_ptr);
--- a/src/shoot.c
+++ b/src/shoot.c
@@ -370,7 +370,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
370370 }
371371 else
372372 {
373- o_ptr = &o_list[0 - item];
373+ o_ptr = &current_floor_ptr->o_list[0 - item];
374374 }
375375
376376 /* Sniper - Cannot shot a single arrow twice */
@@ -839,7 +839,7 @@ void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
839839 return;
840840 }
841841
842- o_ptr = &o_list[o_idx];
842+ o_ptr = &current_floor_ptr->o_list[o_idx];
843843 object_copy(o_ptr, q_ptr);
844844
845845 /* Forget mark */
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -27,7 +27,7 @@ void wiz_lite(bool ninja)
2727 /* Memorize objects */
2828 for (i = 1; i < o_max; i++)
2929 {
30- object_type *o_ptr = &o_list[i];
30+ object_type *o_ptr = &current_floor_ptr->o_list[i];
3131
3232 /* Skip dead objects */
3333 if (!o_ptr->k_idx) continue;
@@ -144,7 +144,7 @@ void wiz_dark(void)
144144 /* Forget all objects */
145145 for (i = 1; i < o_max; i++)
146146 {
147- object_type *o_ptr = &o_list[i];
147+ object_type *o_ptr = &current_floor_ptr->o_list[i];
148148
149149 /* Skip dead objects */
150150 if (!o_ptr->k_idx) continue;
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -441,7 +441,7 @@ bool cosmic_cast_off(player_type *creature_ptr, object_type *o_ptr)
441441 inven_item_increase(inv, (0 - o_ptr->number));
442442 inven_item_optimize(inv);
443443 o_idx = drop_near(&forge, 0, creature_ptr->y, creature_ptr->x);
444- o_ptr = &o_list[o_idx];
444+ o_ptr = &current_floor_ptr->o_list[o_idx];
445445
446446 object_desc(o_name, o_ptr, OD_NAME_ONLY);
447447 msg_format(_("%sを脱ぎ捨てた。", "You cast off %s."), o_name);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -639,7 +639,7 @@ static bool project_o(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
639639 /* Scan all objects in the grid */
640640 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
641641 {
642- object_type *o_ptr = &o_list[this_o_idx];
642+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
643643
644644 bool is_art = FALSE;
645645 bool ignore = FALSE;
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -179,7 +179,7 @@ bool detect_objects_gold(POSITION range)
179179 /* Scan objects */
180180 for (i = 1; i < o_max; i++)
181181 {
182- object_type *o_ptr = &o_list[i];
182+ object_type *o_ptr = &current_floor_ptr->o_list[i];
183183
184184 /* Skip dead objects */
185185 if (!o_ptr->k_idx) continue;
@@ -234,7 +234,7 @@ bool detect_objects_normal(POSITION range)
234234 /* Scan objects */
235235 for (i = 1; i < o_max; i++)
236236 {
237- object_type *o_ptr = &o_list[i];
237+ object_type *o_ptr = &current_floor_ptr->o_list[i];
238238
239239 /* Skip dead objects */
240240 if (!o_ptr->k_idx) continue;
@@ -297,7 +297,7 @@ bool detect_objects_magic(POSITION range)
297297 /* Scan all objects */
298298 for (i = 1; i < o_max; i++)
299299 {
300- object_type *o_ptr = &o_list[i];
300+ object_type *o_ptr = &current_floor_ptr->o_list[i];
301301
302302 /* Skip dead objects */
303303 if (!o_ptr->k_idx) continue;
@@ -1490,7 +1490,7 @@ bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
14901490 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
14911491 {
14921492 object_type *o_ptr;
1493- o_ptr = &o_list[this_o_idx];
1493+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
14941494
14951495 /* Acquire next object */
14961496 next_o_idx = o_ptr->next_o_idx;
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1659,7 +1659,7 @@ void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
16591659 while (!g_ptr->o_idx);
16601660 }
16611661
1662- o_ptr = &o_list[g_ptr->o_idx];
1662+ o_ptr = &current_floor_ptr->o_list[g_ptr->o_idx];
16631663
16641664 if (o_ptr->weight > wgt)
16651665 {
@@ -3976,7 +3976,7 @@ bool polymorph_monster(POSITION y, POSITION x)
39763976 {
39773977 for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
39783978 {
3979- object_type *o_ptr = &o_list[this_o_idx];
3979+ object_type *o_ptr = &current_floor_ptr->o_list[this_o_idx];
39803980
39813981 /* Acquire next object */
39823982 next_o_idx = o_ptr->next_o_idx;
@@ -3990,7 +3990,7 @@ bool polymorph_monster(POSITION y, POSITION x)
39903990 for (this_o_idx = back_m.hold_o_idx; this_o_idx; this_o_idx = next_o_idx)
39913991 {
39923992 /* Acquire next object */
3993- next_o_idx = o_list[this_o_idx].next_o_idx;
3993+ next_o_idx = current_floor_ptr->o_list[this_o_idx].next_o_idx;
39943994 delete_object_idx(this_o_idx);
39953995 }
39963996 }
--- a/src/types.h
+++ b/src/types.h
@@ -1883,4 +1883,9 @@ typedef struct {
18831883 POSITION width; /* Current dungeon width */
18841884 POSITION height; /* Current dungeon height */
18851885 MONSTER_NUMBER num_repro; /*!< Current reproducer count */
1886-} floor_type;
\ No newline at end of file
1886+
1887+ object_type *o_list; /*!< The array of dungeon items [current_floor_ptr->max_o_idx] */
1888+ OBJECT_IDX max_o_idx; /*!< Maximum number of objects in the level */
1889+
1890+} floor_type;
1891+
--- a/src/variable.c
+++ b/src/variable.c
@@ -483,11 +483,6 @@ u32b saved_floor_file_sign;
483483
484484
485485 /*
486- * The array of dungeon items [max_o_idx]
487- */
488-object_type *o_list;
489-
490-/*
491486 * The array of dungeon monsters [max_m_idx]
492487 */
493488 monster_type *m_list;
@@ -772,11 +767,6 @@ EGO_IDX max_e_idx;
772767 DUNGEON_IDX max_d_idx;
773768
774769 /*
775- * Maximum number of objects in the level
776- */
777-OBJECT_IDX max_o_idx;
778-
779-/*
780770 * Maximum number of monsters in the level
781771 */
782772 MONSTER_IDX max_m_idx;
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -756,7 +756,7 @@ static bool target_set_accept(POSITION y, POSITION x)
756756 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
757757 {
758758 object_type *o_ptr;
759- o_ptr = &o_list[this_o_idx];
759+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
760760
761761 /* Acquire next object */
762762 next_o_idx = o_ptr->next_o_idx;
@@ -1112,7 +1112,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
11121112 GAME_TEXT o_name[MAX_NLEN];
11131113
11141114 object_type *o_ptr;
1115- o_ptr = &o_list[this_o_idx];
1115+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
11161116
11171117 /* Acquire next object */
11181118 next_o_idx = o_ptr->next_o_idx;
@@ -1160,7 +1160,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
11601160 GAME_TEXT o_name[MAX_NLEN];
11611161
11621162 object_type *o_ptr;
1163- o_ptr = &o_list[floor_list[0]];
1163+ o_ptr = &current_floor_ptr->o_list[floor_list[0]];
11641164
11651165 object_desc(o_name, o_ptr, 0);
11661166
@@ -1236,18 +1236,18 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
12361236 o_idx = g_ptr->o_idx;
12371237
12381238 /* Only rotate a pile of two or more objects. */
1239- if (!(o_idx && o_list[o_idx].next_o_idx)) continue;
1239+ if (!(o_idx && current_floor_ptr->o_list[o_idx].next_o_idx)) continue;
12401240
12411241 /* Remove the first object from the list. */
12421242 excise_object_idx(o_idx);
12431243
12441244 /* Find end of the list. */
12451245 i = g_ptr->o_idx;
1246- while (o_list[i].next_o_idx)
1247- i = o_list[i].next_o_idx;
1246+ while (current_floor_ptr->o_list[i].next_o_idx)
1247+ i = current_floor_ptr->o_list[i].next_o_idx;
12481248
12491249 /* Add after the last object. */
1250- o_list[i].next_o_idx = o_idx;
1250+ current_floor_ptr->o_list[i].next_o_idx = o_idx;
12511251
12521252 /* Loop and re-display the list */
12531253 }
@@ -1260,7 +1260,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
12601260 for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
12611261 {
12621262 object_type *o_ptr;
1263- o_ptr = &o_list[this_o_idx];
1263+ o_ptr = &current_floor_ptr->o_list[this_o_idx];
12641264
12651265 /* Acquire next object */
12661266 next_o_idx = o_ptr->next_o_idx;
Show on old repository browser