• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision27fbbe3330614dbe7f4d665522fbfa9c5520b51f (tree)
Time2019-07-03 23:48:10
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 choose_realm() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -567,7 +567,7 @@ static void show_help(concptr helpfile)
567567 * @param count 選択可能な魔法領域を返すポインタ群。
568568 * @return 選択した魔法領域のID
569569 */
570-static byte choose_realm(s32b choices, int *count)
570+static byte choose_realm(player_type *creature_ptr, s32b choices, int *count)
571571 {
572572 int picks[VALID_REALM] = {0};
573573 int k, i, cs, os;
@@ -651,11 +651,11 @@ static byte choose_realm(s32b choices, int *count)
651651 if ((*count) < 2) return auto_select;
652652
653653 /* Constraint to the 1st realm */
654- if (p_ptr->realm2 != 255)
654+ if (creature_ptr->realm2 != 255)
655655 {
656- if (p_ptr->pclass == CLASS_PRIEST)
656+ if (creature_ptr->pclass == CLASS_PRIEST)
657657 {
658- if (is_good_realm(p_ptr->realm1))
658+ if (is_good_realm(creature_ptr->realm1))
659659 {
660660 choices &= ~(CH_DEATH | CH_DAEMON);
661661 }
@@ -675,14 +675,14 @@ static byte choose_realm(s32b choices, int *count)
675675 /* Analize realms */
676676 if (choices & (1L << i))
677677 {
678- if (p_ptr->realm1 == i+1)
678+ if (creature_ptr->realm1 == i+1)
679679 {
680- if (p_ptr->realm2 == 255)
680+ if (creature_ptr->realm2 == 255)
681681 cs = n;
682682 else
683683 continue;
684684 }
685- if (p_ptr->realm2 == i+1)
685+ if (creature_ptr->realm2 == i+1)
686686 cs = n;
687687
688688 sym[n] = I2A(n);
@@ -823,7 +823,7 @@ static bool get_player_realms(void)
823823 char temp[80*10];
824824 concptr t;
825825 count = 0;
826- p_ptr->realm1 = choose_realm(realm_choices1[p_ptr->pclass], &count);
826+ p_ptr->realm1 = choose_realm(p_ptr, realm_choices1[p_ptr->pclass], &count);
827827
828828 if (255 == p_ptr->realm1) return FALSE;
829829 if (!p_ptr->realm1) break;
@@ -872,7 +872,7 @@ static bool get_player_realms(void)
872872 concptr t;
873873
874874 count = 0;
875- p_ptr->realm2 = choose_realm(realm_choices2[p_ptr->pclass], &count);
875+ p_ptr->realm2 = choose_realm(p_ptr, realm_choices2[p_ptr->pclass], &count);
876876
877877 if (255 == p_ptr->realm2) return FALSE;
878878 if (!p_ptr->realm2) break;
Show on old repository browser