From: Hourier Date: Thu, 16 Jul 2020 14:22:19 +0000 (+0900) Subject: [Refactor] #40233 Separated check_free_space() from store_check_num() X-Git-Tag: vmacos3.0.0-alpha52~782^2~163 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=967247abe17bb37d71cd58878c12f6c721bb2c4e;p=hengbandforosx%2Fhengbandosx.git [Refactor] #40233 Separated check_free_space() from store_check_num() --- diff --git a/src/store/store.c b/src/store/store.c index 90265984c..7c4d7c30f 100644 --- a/src/store/store.c +++ b/src/store/store.c @@ -46,6 +46,24 @@ int cur_store_feat; /* Enable "increments" */ bool allow_inc = FALSE; +/* + * @brief アイテムが格納可能な数より多いかをチェックする + * @param なし + * @return エラーコード + * オプション powerup_home が設定されていると我が家が 20 ページまで使える / + * Free space is always usable + */ +static errr check_free_space(void) +{ + if ((cur_store_num == STORE_HOME) && !powerup_home) + if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) + return 1; + else if (st_ptr->stock_num < st_ptr->stock_size) + return 1; + + return 0; +} + /*! * @brief 店舗に品を置くスペースがあるかどうかの判定を返す / * Check to see if the shop will be carrying too many objects -RAK- @@ -96,22 +114,7 @@ int store_check_num(object_type *o_ptr) } } - /* Free space is always usable */ - /* - * オプション powerup_home が設定されていると - * 我が家が 20 ページまで使える - */ - if ((cur_store_num == STORE_HOME) && !powerup_home) { - if (st_ptr->stock_num < ((st_ptr->stock_size) / 10)) { - return 1; - } - } else { - if (st_ptr->stock_num < st_ptr->stock_size) { - return 1; - } - } - - return 0; + return check_free_space(); } /*!