OSDN Git Service

[Refactor] #38844 reset_concentrate を player_type 構造体へ移動.
authordeskull <deskull@users.sourceforge.jp>
Thu, 30 May 2019 16:25:39 +0000 (01:25 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Thu, 30 May 2019 16:26:51 +0000 (01:26 +0900)
src/core.c
src/externs.h
src/player-status.h
src/snipe.c
src/variable.c

index 6d55f80..f90a425 100644 (file)
@@ -3523,7 +3523,7 @@ static void process_command(void)
 
        /* Sniper */
        if ((p_ptr->pclass == CLASS_SNIPER) && (p_ptr->concent))
-               reset_concent = TRUE;
+               p_ptr->reset_concent = TRUE;
 
        /* Parse the command */
        switch (command_cmd)
@@ -4896,7 +4896,7 @@ static void process_player(void)
                }
 
                /* Sniper */
-               if (p_ptr->energy_use && reset_concent) reset_concentration(TRUE);
+               if (p_ptr->energy_use && p_ptr->reset_concent) reset_concentration(TRUE);
 
                /* Handle "leaving" */
                if (p_ptr->leaving) break;
index e879f25..79204e6 100644 (file)
@@ -48,8 +48,6 @@ extern const byte adj_chr_chm[];
 extern bool repair_monsters;
 extern bool repair_objects;
 
-extern bool reset_concent;
-
 
 
 /*
index cd94b74..3625d21 100644 (file)
@@ -364,6 +364,8 @@ struct player_type
        bool now_damaged;
        bool ambush_flag;
 
+       bool reset_concent;   /* Concentration reset flag */
+
        bool wizard;              /* Player is in wizard mode */
 
        MONSTER_IDX riding;              /* Riding on a monster of this index */
index d0b5866..73c7ac1 100644 (file)
@@ -120,7 +120,7 @@ static bool snipe_concentrate(void)
        if ((int)p_ptr->concent < (2 + (p_ptr->lev + 5) / 10)) p_ptr->concent++;
 
        msg_format(_("集中した。(集中度 %d)", "You concentrate deeply. (lvl %d)"), p_ptr->concent);
-       reset_concent = FALSE;
+       p_ptr->reset_concent = FALSE;
 
        p_ptr->update |= (PU_BONUS | PU_MONSTERS);
        p_ptr->redraw |= (PR_STATUS);
@@ -140,7 +140,7 @@ void reset_concentration(bool msg)
        }
 
        p_ptr->concent = 0;
-       reset_concent = FALSE;
+       p_ptr->reset_concent = FALSE;
 
        p_ptr->update |= (PU_BONUS | PU_MONSTERS);
        p_ptr->redraw |= (PR_STATUS);
index 7772eac..f22e18a 100644 (file)
@@ -80,9 +80,3 @@ int server_port;
 
 /* for movie */
 bool browsing_movie;
-
-
-/* for snipers */
-bool reset_concent = FALSE;   /* Concentration reset flag */
-
-