変愚蛮怒のメインリポジトリです
修订版 | 3ab020f90814d9a5550de49d97bad963f40f43f9 (tree) |
---|---|
时间 | 2019-10-06 19:33:05 |
作者 | deskull <deskull@user...> |
Commiter | deskull |
[Refactor] #38997 exe_fire() 内のポインタ参照再修正. / Fix pointer reference in exe_fire().
@@ -389,7 +389,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
389 | 389 | } |
390 | 390 | else |
391 | 391 | { |
392 | - o_ptr = &p_ptr->current_floor_ptr->o_list[0 - item]; | |
392 | + o_ptr = &shooter_ptr->current_floor_ptr->o_list[0 - item]; | |
393 | 393 | } |
394 | 394 | |
395 | 395 | /* Sniper - Cannot shot a single arrow twice */ |
@@ -536,7 +536,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
536 | 536 | /* Shatter Arrow */ |
537 | 537 | if (snipe_type == SP_KILL_WALL) |
538 | 538 | { |
539 | - g_ptr = &p_ptr->current_floor_ptr->grid_array[ny][nx]; | |
539 | + g_ptr = &shooter_ptr->current_floor_ptr->grid_array[ny][nx]; | |
540 | 540 | |
541 | 541 | if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx) |
542 | 542 | { |
@@ -554,7 +554,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
554 | 554 | } |
555 | 555 | |
556 | 556 | /* Stopped by walls/doors */ |
557 | - if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx) break; | |
557 | + if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !shooter_ptr->current_floor_ptr->grid_array[ny][nx].m_idx) break; | |
558 | 558 | |
559 | 559 | /* Advance the distance */ |
560 | 560 | cur_dis++; |
@@ -562,7 +562,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
562 | 562 | /* Sniper */ |
563 | 563 | if (snipe_type == SP_LITE) |
564 | 564 | { |
565 | - p_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW); | |
565 | + shooter_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW); | |
566 | 566 | note_spot(ny, nx); |
567 | 567 | lite_spot(ny, nx); |
568 | 568 | } |
@@ -599,7 +599,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
599 | 599 | /* Sniper */ |
600 | 600 | if (snipe_type == SP_EVILNESS) |
601 | 601 | { |
602 | - p_ptr->current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK); | |
602 | + shooter_ptr->current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK); | |
603 | 603 | note_spot(ny, nx); |
604 | 604 | lite_spot(ny, nx); |
605 | 605 | } |
@@ -612,11 +612,11 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
612 | 612 | y = ny; |
613 | 613 | |
614 | 614 | /* Monster here, Try to hit it */ |
615 | - if (p_ptr->current_floor_ptr->grid_array[y][x].m_idx) | |
615 | + if (shooter_ptr->current_floor_ptr->grid_array[y][x].m_idx) | |
616 | 616 | { |
617 | - grid_type *c_mon_ptr = &p_ptr->current_floor_ptr->grid_array[y][x]; | |
617 | + grid_type *c_mon_ptr = &shooter_ptr->current_floor_ptr->grid_array[y][x]; | |
618 | 618 | |
619 | - monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[c_mon_ptr->m_idx]; | |
619 | + monster_type *m_ptr = &shooter_ptr->current_floor_ptr->m_list[c_mon_ptr->m_idx]; | |
620 | 620 | monster_race *r_ptr = &r_info[m_ptr->r_idx]; |
621 | 621 | |
622 | 622 | /* Check the visibility */ |
@@ -649,7 +649,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
649 | 649 | if (shooter_ptr->riding) |
650 | 650 | { |
651 | 651 | if ((shooter_ptr->skill_exp[GINOU_RIDING] < s_info[shooter_ptr->pclass].s_max[GINOU_RIDING]) |
652 | - && ((shooter_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[p_ptr->current_floor_ptr->m_list[shooter_ptr->riding].r_idx].level) | |
652 | + && ((shooter_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[shooter_ptr->current_floor_ptr->m_list[shooter_ptr->riding].r_idx].level) | |
653 | 653 | && one_in_(2)) |
654 | 654 | { |
655 | 655 | shooter_ptr->skill_exp[GINOU_RIDING] += 1; |
@@ -735,7 +735,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
735 | 735 | /* Sniper */ |
736 | 736 | if (snipe_type == SP_HOLYNESS) |
737 | 737 | { |
738 | - p_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW); | |
738 | + shooter_ptr->current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW); | |
739 | 739 | note_spot(ny, nx); |
740 | 740 | lite_spot(ny, nx); |
741 | 741 | } |
@@ -796,13 +796,13 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
796 | 796 | if (!in_bounds2(shooter_ptr->current_floor_ptr, ny, nx)) break; |
797 | 797 | |
798 | 798 | /* Stopped by walls/doors */ |
799 | - if (!player_can_enter(p_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0)) break; | |
799 | + if (!player_can_enter(shooter_ptr->current_floor_ptr->grid_array[ny][nx].feat, 0)) break; | |
800 | 800 | |
801 | 801 | /* Stopped by monsters */ |
802 | 802 | if (!cave_empty_bold(ny, nx)) break; |
803 | 803 | |
804 | - p_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx; | |
805 | - p_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0; | |
804 | + shooter_ptr->current_floor_ptr->grid_array[ny][nx].m_idx = m_idx; | |
805 | + shooter_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = 0; | |
806 | 806 | |
807 | 807 | m_ptr->fx = nx; |
808 | 808 | m_ptr->fy = ny; |
@@ -842,8 +842,8 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
842 | 842 | |
843 | 843 | if (stick_to) |
844 | 844 | { |
845 | - MONSTER_IDX m_idx = p_ptr->current_floor_ptr->grid_array[y][x].m_idx; | |
846 | - monster_type *m_ptr = &p_ptr->current_floor_ptr->m_list[m_idx]; | |
845 | + MONSTER_IDX m_idx = shooter_ptr->current_floor_ptr->grid_array[y][x].m_idx; | |
846 | + monster_type *m_ptr = &shooter_ptr->current_floor_ptr->m_list[m_idx]; | |
847 | 847 | OBJECT_IDX o_idx = o_pop(); |
848 | 848 | |
849 | 849 | if (!o_idx) |
@@ -856,7 +856,7 @@ void exe_fire(player_type *shooter_ptr, INVENTORY_IDX item, object_type *j_ptr, | ||
856 | 856 | return; |
857 | 857 | } |
858 | 858 | |
859 | - o_ptr = &p_ptr->current_floor_ptr->o_list[o_idx]; | |
859 | + o_ptr = &shooter_ptr->current_floor_ptr->o_list[o_idx]; | |
860 | 860 | object_copy(o_ptr, q_ptr); |
861 | 861 | |
862 | 862 | /* Forget mark */ |