From 286ffc20a92b5fb7461294006c0ad89eaba932e0 Mon Sep 17 00:00:00 2001 From: deskull Date: Fri, 21 Aug 2020 00:42:42 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20#40514=20calc=5Fto=5Fdamage()=20?= =?utf8?q?=E3=81=A8=20calc=5Fto=5Fdamage=5Fdisplay()=20=E3=81=AE=E9=87=8D?= =?utf8?q?=E8=A4=87=E5=87=A6=E7=90=86=E3=82=92=E5=89=8A=E9=99=A4.=20/=20Re?= =?utf8?q?moved=20duplicate=20processing=20of=20calc=5Fto=5Fdamage()=20and?= =?utf8?q?=20calc=5Fto=5Fdamage=5Fdisplay().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/player/player-status.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/player/player-status.c b/src/player/player-status.c index af3fe8849..fb247d4eb 100644 --- a/src/player/player-status.c +++ b/src/player/player-status.c @@ -3040,8 +3040,8 @@ static void calc_to_damage(player_type *creature_ptr, INVENTORY_IDX slot) } if (have_right_hand_weapon(creature_ptr) && have_left_hand_weapon(creature_ptr)) { - creature_ptr->to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d; - creature_ptr->to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d; + if (id == 0) creature_ptr->to_d[id] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d; + if (id == 1) creature_ptr->to_d[id] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d; continue; } else if (id == get_default_hand(creature_ptr)) creature_ptr->to_d[id] += (s16b)bonus_to_d; @@ -3126,9 +3126,8 @@ static void calc_to_damage_display(player_type *creature_ptr, INVENTORY_IDX slot if (have_right_hand_weapon(creature_ptr) && have_left_hand_weapon(creature_ptr)) { if (!object_is_known(o_ptr)) continue; - creature_ptr->dis_to_d[0] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d; - creature_ptr->dis_to_d[1] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d; - continue; + if(id == 0) creature_ptr->dis_to_d[id] += (bonus_to_d > 0) ? (bonus_to_d + 1) / 2 : bonus_to_d; + if(id == 1) creature_ptr->dis_to_d[id] += (bonus_to_d > 0) ? bonus_to_d / 2 : bonus_to_d; } else if (id == get_default_hand(creature_ptr)) { if(object_is_known(o_ptr)) creature_ptr->to_d[id] += (s16b)bonus_to_d; } -- 2.11.0