if (c == '8') {
if (*cs >= 4)
*cs -= 4;
- if (*cs != MAX_SEIKAKU && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
+ if ((*cs != MAX_SEIKAKU) && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
if ((*cs - 4) > 0)
*cs -= 4;
else
if (c == '4') {
if (*cs > 0)
- *cs--;
- if (*cs != MAX_SEIKAKU && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
+ (*cs)--;
+ if ((*cs != MAX_SEIKAKU) && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
if ((*cs - 1) > 0)
(*cs)--;
else
if (c == '6') {
if (*cs < MAX_SEIKAKU)
- *cs++;
- if (*cs != MAX_SEIKAKU && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
+ (*cs)++;
+ if ((*cs != MAX_SEIKAKU) && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
if ((*cs + 1) <= MAX_SEIKAKU)
(*cs)++;
else
if (c == '2') {
if ((*cs + 4) <= MAX_SEIKAKU)
*cs += 4;
- if (*cs != MAX_SEIKAKU && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
+ if ((*cs != MAX_SEIKAKU) && seikaku_info[*cs].sex && (seikaku_info[*cs].sex != (creature_ptr->psex + 1))) {
if ((*cs + 4) <= MAX_SEIKAKU)
*cs += 4;
else
#include "term/gameterm.h"
#include "birth/birth-util.h"
+static void interpret_race_select_key_move(char c, int *cs)
+{
+ if (c == '8') {
+ if (*cs >= 5)
+ cs -= 5;
+ }
+
+ if (c == '4') {
+ if (*cs > 0)
+ (*cs)--;
+ }
+
+ if (c == '6') {
+ if (*cs < MAX_RACES)
+ (*cs)++;
+ }
+
+ if (c == '2') {
+ if ((*cs + 5) <= MAX_RACES)
+ *cs += 5;
+ }
+}
+
/*!
* @brief プレイヤーの種族選択を行う / Player race
* @return なし
rp_ptr->r_adj[4], rp_ptr->r_adj[5], (rp_ptr->r_exp - 100));
c_put_str(TERM_L_BLUE, buf, 5, 40);
}
+
c_put_str(TERM_YELLOW, cur, 12 + (cs / 5), 1 + 16 * (cs % 5));
os = cs;
}
continue;
}
- if (c == '8') {
- if (cs >= 5)
- cs -= 5;
- }
-
- if (c == '4') {
- if (cs > 0)
- cs--;
- }
-
- if (c == '6') {
- if (cs < MAX_RACES)
- cs++;
- }
-
- if (c == '2') {
- if ((cs + 5) <= MAX_RACES)
- cs += 5;
- }
-
+ interpret_race_select_key_move(c, &cs);
k = (islower(c) ? A2I(c) : -1);
if ((k >= 0) && (k < MAX_RACES)) {
cs = k;