• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb9b09e10806585fcfa6011342ce9d5865554b621 (tree)
Time2019-07-10 12:33:11
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -71,11 +71,11 @@ void do_cmd_inven(void)
7171 #ifdef JP
7272 sprintf(out_val, "持ち物: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
7373 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
74- (long int)((p_ptr->total_weight * 100) / weight_limit()));
74+ (long int)((p_ptr->total_weight * 100) / weight_limit(p_ptr)));
7575 #else
7676 sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
7777 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
78- (p_ptr->total_weight * 100) / weight_limit());
78+ (p_ptr->total_weight * 100) / weight_limit(p_ptr));
7979 #endif
8080
8181 prt(out_val, 0, 0);
@@ -124,11 +124,11 @@ void do_cmd_equip(void)
124124 #ifdef JP
125125 sprintf(out_val, "装備: 合計 %3d.%1d kg (限界の%ld%%) コマンド: ",
126126 (int)lbtokg1(p_ptr->total_weight) , (int)lbtokg2(p_ptr->total_weight) ,
127- (long int)((p_ptr->total_weight * 100) / weight_limit()));
127+ (long int)((p_ptr->total_weight * 100) / weight_limit(p_ptr)));
128128 #else
129129 sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
130130 (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
131- (long int)((p_ptr->total_weight * 100) / weight_limit()));
131+ (long int)((p_ptr->total_weight * 100) / weight_limit(p_ptr)));
132132 #endif
133133
134134 prt(out_val, 0, 0);
--- a/src/core.c
+++ b/src/core.c
@@ -1627,7 +1627,7 @@ static void process_world_aux_hp_and_sp(void)
16271627 if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
16281628 !p_ptr->levitation && !p_ptr->can_swim && !p_ptr->resist_water)
16291629 {
1630- if (p_ptr->total_weight > weight_limit())
1630+ if (p_ptr->total_weight > weight_limit(p_ptr))
16311631 {
16321632 msg_print(_("溺れている!", "You are drowning!"));
16331633 take_hit(p_ptr, DAMAGE_NOESCAPE, randint1(p_ptr->lev), _("溺れ", "drowning"), -1);
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -1616,7 +1616,7 @@ static bool run_test(void)
16161616
16171617 /* Deep water */
16181618 else if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
1619- (p_ptr->levitation || p_ptr->can_swim || (p_ptr->total_weight <= weight_limit())))
1619+ (p_ptr->levitation || p_ptr->can_swim || (p_ptr->total_weight <= weight_limit(p_ptr))))
16201620 {
16211621 /* Ignore */
16221622 notice = FALSE;
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -3065,7 +3065,7 @@ void calc_bonuses(void)
30653065 if (!p_ptr->riding)
30663066 {
30673067 /* Extract the "weight limit" (in tenth pounds) */
3068- i = (int)weight_limit();
3068+ i = (int)weight_limit(p_ptr);
30693069 }
30703070 else
30713071 {
@@ -4910,13 +4910,13 @@ s16b calc_num_fire(object_type *o_ptr)
49104910 * Computes current weight limit.
49114911 * @return 制限重量(ポンド)
49124912 */
4913-WEIGHT weight_limit(void)
4913+WEIGHT weight_limit(player_type *creature_ptr)
49144914 {
49154915 WEIGHT i;
49164916
49174917 /* Weight limit based only on strength */
4918- i = (WEIGHT)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
4919- if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
4918+ i = (WEIGHT)adj_str_wgt[creature_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
4919+ if (creature_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
49204920
49214921 /* Return the result */
49224922 return i;
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -732,7 +732,7 @@ extern int spell_exp_level(int spell_exp);
732732
733733 extern s16b calc_num_fire(object_type *o_ptr);
734734 extern void calc_bonuses(void);
735-extern WEIGHT weight_limit(void);
735+extern WEIGHT weight_limit(player_type *creature_ptr);
736736 extern bool has_melee_weapon(player_type *creature_ptr, int i);
737737 extern bool is_heavy_shoot(object_type *o_ptr);
738738
Show on old repository browser