• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionf497574de4e4623bcdb44b3f4b75cda65158d91b (tree)
Time2019-02-09 19:10:03
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 配列用ポインタ town を他の慣例に従い town_info に改名。 / Rename town pointer to town_info according to custom.

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -3671,7 +3671,7 @@ bool tele_town(void)
36713671
36723672 if ((i == NO_TOWN) || (i == SECRET_TOWN) || (i == p_ptr->town_num) || !(p_ptr->visit & (1L << (i - 1)))) continue;
36733673
3674- sprintf(buf, "%c) %-20s", I2A(i - 1), town[i].name);
3674+ sprintf(buf, "%c) %-20s", I2A(i - 1), town_info[i].name);
36753675 prt(buf, 5 + i, 5);
36763676 num++;
36773677 }
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -3866,7 +3866,7 @@ void do_cmd_feeling(void)
38663866 /* No useful feeling in town */
38673867 else if (p_ptr->town_num && !dun_level)
38683868 {
3869- if (!strcmp(town[p_ptr->town_num].name, _("荒野", "wilderness")))
3869+ if (!strcmp(town_info[p_ptr->town_num].name, _("荒野", "wilderness")))
38703870 {
38713871 msg_print(_("何かありそうな荒野のようだ。", "Looks like a strange wilderness."));
38723872 return;
@@ -4800,7 +4800,7 @@ static void do_cmd_knowledge_inven(void)
48004800 do_cmd_knowledge_inven_aux(fff, &inventory[i], &j, tval, where);
48014801 }
48024802
4803- st_ptr = &town[1].store[STORE_HOME];
4803+ st_ptr = &town_info[1].store[STORE_HOME];
48044804 strcpy(where, _("家", "H "));
48054805 for (i = 0; i < st_ptr->stock_num; i++)
48064806 {
@@ -8095,7 +8095,7 @@ static void do_cmd_knowledge_home(void)
80958095 if (fff)
80968096 {
80978097 /* Print all homes in the different towns */
8098- st_ptr = &town[1].store[STORE_HOME];
8098+ st_ptr = &town_info[1].store[STORE_HOME];
80998099
81008100 /* Home -- if anything there */
81018101 if (st_ptr->stock_num)
--- a/src/dungeon.c
+++ b/src/dungeon.c
@@ -6242,7 +6242,7 @@ void prevent_turn_overflow(void)
62426242 {
62436243 for (j = 0; j < MAX_STORES; j++)
62446244 {
6245- store_type *st_ptr = &town[i].store[j];
6245+ store_type *st_ptr = &town_info[i].store[j];
62466246
62476247 if (st_ptr->last_visit > -10L * TURNS_PER_TICK * STORE_TICKS)
62486248 {
--- a/src/externs.h
+++ b/src/externs.h
@@ -273,7 +273,7 @@ extern monster_type *m_list;
273273 extern s16b *mproc_list[MAX_MTIMED];
274274 extern s16b mproc_max[MAX_MTIMED];
275275 extern u16b max_towns;
276-extern town_type *town;
276+extern town_type *town_info;
277277 extern object_type *inventory;
278278 extern s16b alloc_kind_size;
279279 extern alloc_entry *alloc_kind_table;
--- a/src/files.c
+++ b/src/files.c
@@ -4899,7 +4899,7 @@ static void dump_aux_home_museum(FILE *fff)
48994899 /* process_dungeon_file("w_info.txt", 0, 0, max_wild_y, max_wild_x); */
49004900
49014901 /* Print the home */
4902- st_ptr = &town[1].store[STORE_HOME];
4902+ st_ptr = &town_info[1].store[STORE_HOME];
49034903
49044904 /* Home -- if anything there */
49054905 if (st_ptr->stock_num)
@@ -4924,7 +4924,7 @@ static void dump_aux_home_museum(FILE *fff)
49244924
49254925
49264926 /* Print the home */
4927- st_ptr = &town[1].store[STORE_MUSEUM];
4927+ st_ptr = &town_info[1].store[STORE_MUSEUM];
49284928
49294929 /* Home -- if anything there */
49304930 if (st_ptr->stock_num)
@@ -6546,7 +6546,7 @@ static void show_info(void)
65466546
65476547 for (i = 1; i < max_towns; i++)
65486548 {
6549- st_ptr = &town[i].store[STORE_HOME];
6549+ st_ptr = &town_info[i].store[STORE_HOME];
65506550
65516551 /* Hack -- Know everything in the home */
65526552 for (j = 0; j < st_ptr->stock_num; j++)
@@ -6634,7 +6634,7 @@ static void show_info(void)
66346634 /* Homes in the different towns */
66356635 for (l = 1; l < max_towns; l++)
66366636 {
6637- st_ptr = &town[l].store[STORE_HOME];
6637+ st_ptr = &town_info[l].store[STORE_HOME];
66386638
66396639 /* Home -- if anything there */
66406640 if (st_ptr->stock_num)
--- a/src/init2.c
+++ b/src/init2.c
@@ -887,20 +887,20 @@ static errr init_towns(void)
887887 /*** Prepare the Towns ***/
888888
889889 /* Allocate the towns */
890- C_MAKE(town, max_towns, town_type);
890+ C_MAKE(town_info, max_towns, town_type);
891891
892892 for (i = 1; i < max_towns; i++)
893893 {
894894 /*** Prepare the Stores ***/
895895
896896 /* Allocate the stores */
897- C_MAKE(town[i].store, MAX_STORES, store_type);
897+ C_MAKE(town_info[i].store, MAX_STORES, store_type);
898898
899899 /* Fill in each store */
900900 for (j = 0; j < MAX_STORES; j++)
901901 {
902902 /* Access the store */
903- store_type *st_ptr = &town[i].store[j];
903+ store_type *st_ptr = &town_info[i].store[j];
904904
905905 if ((i > 1) && (j == STORE_MUSEUM || j == STORE_HOME)) continue;
906906
--- a/src/load.c
+++ b/src/load.c
@@ -1374,12 +1374,12 @@ static errr rd_store(int town_number, int store_number)
13741374
13751375 if (z_older_than(10, 3, 3) && (store_number == STORE_HOME))
13761376 {
1377- st_ptr = &town[1].store[store_number];
1377+ st_ptr = &town_info[1].store[store_number];
13781378 if (st_ptr->stock_num) sort = TRUE;
13791379 }
13801380 else
13811381 {
1382- st_ptr = &town[town_number].store[store_number];
1382+ st_ptr = &town_info[town_number].store[store_number];
13831383 }
13841384
13851385 /* Read the basic info */
--- a/src/rumor.c
+++ b/src/rumor.c
@@ -123,10 +123,10 @@ void display_rumor(bool ex)
123123 while (1)
124124 {
125125 t_idx = rumor_num(zz[1], NO_TOWN);
126- if (town[t_idx].name) break;
126+ if (town_info[t_idx].name) break;
127127 }
128128
129- strcpy(fullname, town[t_idx].name);
129+ strcpy(fullname, town_info[t_idx].name);
130130
131131 visit = (1L << (t_idx - 1));
132132 if ((t_idx != SECRET_TOWN) && !(p_ptr->visit & visit))
--- a/src/save.c
+++ b/src/save.c
@@ -1496,7 +1496,7 @@ static bool wr_savefile_new(void)
14961496 {
14971497 for (j = 0; j < MAX_STORES; j++)
14981498 {
1499- wr_store(&town[i].store[j]);
1499+ wr_store(&town_info[i].store[j]);
15001500 }
15011501 }
15021502
--- a/src/store.c
+++ b/src/store.c
@@ -2844,7 +2844,7 @@ bool combine_and_reorder_home(int store_num)
28442844 bool old_stack_force_notes = stack_force_notes;
28452845 bool old_stack_force_costs = stack_force_costs;
28462846
2847- st_ptr = &town[1].store[store_num];
2847+ st_ptr = &town_info[1].store[store_num];
28482848 if (store_num != STORE_HOME)
28492849 {
28502850 stack_force_notes = FALSE;
@@ -3287,9 +3287,9 @@ static bool black_market_crap(object_type *o_ptr)
32873287 if (i == STORE_MUSEUM) continue;
32883288
32893289 /* Check every item in the store */
3290- for (j = 0; j < town[p_ptr->town_num].store[i].stock_num; j++)
3290+ for (j = 0; j < town_info[p_ptr->town_num].store[i].stock_num; j++)
32913291 {
3292- object_type *j_ptr = &town[p_ptr->town_num].store[i].stock[j];
3292+ object_type *j_ptr = &town_info[p_ptr->town_num].store[i].stock[j];
32933293
32943294 /* Duplicate item "type", assume crappy */
32953295 if (o_ptr->k_idx == j_ptr->k_idx) return (TRUE);
@@ -5779,7 +5779,7 @@ void do_cmd_store(void)
57795779 inner_town_num = p_ptr->town_num;
57805780
57815781 /* Hack -- Check the "locked doors" */
5782- if ((town[p_ptr->town_num].store[which].store_open >= turn) ||
5782+ if ((town_info[p_ptr->town_num].store[which].store_open >= turn) ||
57835783 (ironman_shops))
57845784 {
57855785 msg_print(_("ドアに鍵がかかっている。", "The doors are locked."));
@@ -5788,7 +5788,7 @@ void do_cmd_store(void)
57885788 }
57895789
57905790 /* Calculate the number of store maintainances since the last visit */
5791- maintain_num = (turn - town[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
5791+ maintain_num = (turn - town_info[p_ptr->town_num].store[which].last_visit) / (TURNS_PER_TICK * STORE_TICKS);
57925792
57935793 /* Maintain the store max. 10 times */
57945794 if (maintain_num > 10) maintain_num = 10;
@@ -5800,7 +5800,7 @@ void do_cmd_store(void)
58005800 store_maint(p_ptr->town_num, which);
58015801
58025802 /* Save the visit */
5803- town[p_ptr->town_num].store[which].last_visit = turn;
5803+ town_info[p_ptr->town_num].store[which].last_visit = turn;
58045804 }
58055805
58065806 forget_lite();
@@ -5824,7 +5824,7 @@ void do_cmd_store(void)
58245824 cur_store_feat = c_ptr->feat;
58255825
58265826 /* Save the store and owner pointers */
5827- st_ptr = &town[p_ptr->town_num].store[cur_store_num];
5827+ st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
58285828 ot_ptr = &owners[cur_store_num][st_ptr->owner];
58295829
58305830 /* Start at the beginning */
@@ -6037,7 +6037,7 @@ void store_shuffle(int which)
60376037 cur_store_num = which;
60386038
60396039 /* Activate that store */
6040- st_ptr = &town[p_ptr->town_num].store[cur_store_num];
6040+ st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
60416041
60426042 j = st_ptr->owner;
60436043 /* Pick a new owner */
@@ -6048,7 +6048,7 @@ void store_shuffle(int which)
60486048 for (i = 1;i < max_towns; i++)
60496049 {
60506050 if (i == p_ptr->town_num) continue;
6051- if (st_ptr->owner == town[i].store[cur_store_num].owner) break;
6051+ if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
60526052 }
60536053 if (i == max_towns) break;
60546054 }
@@ -6104,7 +6104,7 @@ void store_maint(int town_num, int store_num)
61046104 if (store_num == STORE_MUSEUM) return;
61056105
61066106 /* Activate that store */
6107- st_ptr = &town[town_num].store[store_num];
6107+ st_ptr = &town_info[town_num].store[store_num];
61086108
61096109 /* Activate the owner */
61106110 ot_ptr = &owners[store_num][st_ptr->owner];
@@ -6183,7 +6183,7 @@ void store_init(int town_num, int store_num)
61836183 cur_store_num = store_num;
61846184
61856185 /* Activate that store */
6186- st_ptr = &town[town_num].store[store_num];
6186+ st_ptr = &town_info[town_num].store[store_num];
61876187
61886188
61896189 /* Pick an owner */
@@ -6195,7 +6195,7 @@ void store_init(int town_num, int store_num)
61956195 for (i = 1;i < max_towns; i++)
61966196 {
61976197 if (i == town_num) continue;
6198- if (st_ptr->owner == town[i].store[store_num].owner) break;
6198+ if (st_ptr->owner == town_info[i].store[store_num].owner) break;
61996199 }
62006200 if (i == max_towns) break;
62016201 }
@@ -6237,7 +6237,7 @@ void move_to_black_market(object_type *o_ptr)
62376237 /* Not in town */
62386238 if (!p_ptr->town_num) return;
62396239
6240- st_ptr = &town[p_ptr->town_num].store[STORE_BLACK];
6240+ st_ptr = &town_info[p_ptr->town_num].store[STORE_BLACK];
62416241
62426242 o_ptr->ident |= IDENT_STORE;
62436243
--- a/src/variable.c
+++ b/src/variable.c
@@ -512,7 +512,7 @@ u16b max_towns;
512512 /*
513513 * The towns [max_towns]
514514 */
515-town_type *town;
515+town_type *town_info;
516516
517517
518518 /*
--- a/src/view-mainwindow.c
+++ b/src/view-mainwindow.c
@@ -160,7 +160,7 @@ concptr map_name(void)
160160 else if (p_ptr->inside_battle)
161161 return _("闘技場", "Monster Arena");
162162 else if (!dun_level && p_ptr->town_num)
163- return town[p_ptr->town_num].name;
163+ return town_info[p_ptr->town_num].name;
164164 else
165165 return d_name+d_info[p_ptr->dungeon_idx].name;
166166 }
--- a/src/wild.c
+++ b/src/wild.c
@@ -853,7 +853,7 @@ errr parse_line_wilderness(char *buf, int ymin, int xmin, int ymax, int xmax, in
853853 wilderness[*y][*x].level = w_letter[id].level;
854854 wilderness[*y][*x].town = w_letter[id].town;
855855 wilderness[*y][*x].road = w_letter[id].road;
856- strcpy(town[w_letter[id].town].name, w_letter[id].name);
856+ strcpy(town_info[w_letter[id].town].name, w_letter[id].name);
857857 }
858858
859859 (*y)++;
--- a/src/wizard1.c
+++ b/src/wizard1.c
@@ -2643,7 +2643,7 @@ void spoil_random_artifact(concptr fname)
26432643 }
26442644
26452645 /* random artifacts in home */
2646- st_ptr = &town[1].store[STORE_HOME];
2646+ st_ptr = &town_info[1].store[STORE_HOME];
26472647 for (i = 0; i < st_ptr->stock_num; i++)
26482648 {
26492649 q_ptr = &st_ptr->stock[i];
@@ -2651,7 +2651,7 @@ void spoil_random_artifact(concptr fname)
26512651 }
26522652
26532653 /* random artifacts in museum */
2654- st_ptr = &town[1].store[STORE_MUSEUM];
2654+ st_ptr = &town_info[1].store[STORE_MUSEUM];
26552655 for (i = 0; i < st_ptr->stock_num; i++)
26562656 {
26572657 q_ptr = &st_ptr->stock[i];
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -1362,7 +1362,7 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, concptr info)
13621362 }
13631363 else if (have_flag(f_ptr->flags, FF_TOWN))
13641364 {
1365- name = town[c_ptr->special].name;
1365+ name = town_info[c_ptr->special].name;
13661366 }
13671367 else if (p_ptr->wild_mode && (feat == feat_floor))
13681368 {
Show on old repository browser