OSDN Git Service

[Refactor] #38997 store_shuffle() にplayer_type * 引数を追加 / Added player_type * argument...
authorHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 11:03:53 +0000 (20:03 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 13 Jan 2020 11:03:53 +0000 (20:03 +0900)
src/core.c
src/store.c
src/store.h

index 30e1c7b..1d74555 100644 (file)
@@ -2318,7 +2318,7 @@ static void process_world_aux_mutation(player_type *creature_ptr)
                        while ((n == STORE_HOME) || (n == STORE_MUSEUM));
 
                        msg_print(_("店の主人が丘に向かって走っている!", "You see one of the shopkeepers running for the hills!"));
-                       store_shuffle(n);
+                       store_shuffle(creature_ptr, n);
                }
                msg_print(NULL);
        }
@@ -3254,7 +3254,7 @@ static void process_world(player_type *player_ptr)
                                                if (cheat_xtra) msg_format(_("%sの店主をシャッフルします。", "Shuffle a Shopkeeper of %s."), f_name + f_ptr->name);
 
                                                /* Shuffle it */
-                                               store_shuffle(n);
+                                               store_shuffle(player_ptr, n);
 
                                                break;
                                        }
index 533d91e..f620df9 100644 (file)
@@ -4793,7 +4793,7 @@ static void store_purchase(player_type *player_ptr)
                                                msg_print(_("店主は引退した。", "The shopkeeper retires."));
 
                                                /* Shuffle the store */
-                                               store_shuffle(cur_store_num);
+                                               store_shuffle(player_ptr, cur_store_num);
 
                                                prt("",3,0);
                                                sprintf(buf, "%s (%s)",
@@ -5975,7 +5975,7 @@ void do_cmd_store(player_type *player_ptr)
  * @param which 店舗種類のID
  * @return なし
  */
-void store_shuffle(int which)
+void store_shuffle(player_type *player_ptr, int which)
 {
        int i, j;
 
@@ -5989,7 +5989,7 @@ void store_shuffle(int which)
        cur_store_num = which;
 
        /* Activate that store */
-       st_ptr = &town_info[p_ptr->town_num].store[cur_store_num];
+       st_ptr = &town_info[player_ptr->town_num].store[cur_store_num];
 
        j = st_ptr->owner;
        /* Pick a new owner */
@@ -5999,7 +5999,7 @@ void store_shuffle(int which)
                if (j == st_ptr->owner) continue;
                for (i = 1;i < max_towns; i++)
                {
-                       if (i == p_ptr->town_num) continue;
+                       if (i == player_ptr->town_num) continue;
                        if (st_ptr->owner == town_info[i].store[cur_store_num].owner) break;
                }
                if (i == max_towns) break;
index 357103d..b1f2394 100644 (file)
@@ -80,7 +80,7 @@ struct store_type
 /* store.c */
 extern bool combine_and_reorder_home(int store_num);
 extern void do_cmd_store(player_type *player_ptr);
-extern void store_shuffle(int which);
+extern void store_shuffle(player_type *player_ptr, int which);
 extern void store_maint(player_type *player_ptr, int town_num, int store_num);
 extern void store_init(int town_num, int store_num);
 extern void move_to_black_market(object_type *o_ptr);