From abff65e5d4fa5c818111307457aee77253a55280 Mon Sep 17 00:00:00 2001 From: deskull Date: Tue, 2 Jul 2019 23:42:51 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20get=5Frandom=5Fvirtue()=20?= =?utf8?q?=E3=81=AB=20player=5Ftype=20*=20=E5=BC=95=E6=95=B0=E3=82=92?= =?utf8?q?=E8=BF=BD=E5=8A=A0=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/avatar.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/avatar.c b/src/avatar.c index 5c325341e..86a2f54f0 100644 --- a/src/avatar.c +++ b/src/avatar.c @@ -98,12 +98,12 @@ int virtue_number(player_type *creature_ptr, int type) * @param which 確認したい徳のID * @return なし */ -static void get_random_virtue(int which) +static void get_random_virtue(player_type *creature_ptr, int which) { int type = 0; /* Randomly choose a type */ - while (!(type) || virtue_number(p_ptr, type)) + while (!(type) || virtue_number(creature_ptr, type)) { switch (randint1(29)) { @@ -138,7 +138,7 @@ static void get_random_virtue(int which) } /* Chosen */ - p_ptr->vir_types[which] = (s16b)type; + creature_ptr->vir_types[which] = (s16b)type; } /*! @@ -391,7 +391,7 @@ void get_virtues(player_type *creature_ptr) /* Fill in the blanks */ for (i = 0; i < 8; i++) { - if (creature_ptr->vir_types[i] == 0) get_random_virtue(i); + if (creature_ptr->vir_types[i] == 0) get_random_virtue(creature_ptr, i); } } -- 2.11.0