• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision1429cfd78eeb2ceed7133c423b7ad0a20fc1cc80 (tree)
Zeit2019-10-05 00:57:28
Autordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 pattern_teleport() に player_type * 引数を追加. / Add player_type * argument to pattern_teleport().

Ändern Zusammenfassung

Diff

--- a/src/core.c
+++ b/src/core.c
@@ -609,7 +609,7 @@ static void sense_inventory2(player_type *creature_ptr)
609609 * @brief パターン終点到達時のテレポート処理を行う
610610 * @return なし
611611 */
612-static void pattern_teleport(void)
612+static void pattern_teleport(player_type *creature_ptr)
613613 {
614614 DEPTH min_level = 0;
615615 DEPTH max_level = 99;
@@ -622,27 +622,27 @@ static void pattern_teleport(void)
622622
623623 /* Only downward in ironman mode */
624624 if (ironman_downward)
625- min_level = p_ptr->current_floor_ptr->dun_level;
625+ min_level = creature_ptr->current_floor_ptr->dun_level;
626626
627627 /* Maximum level */
628- if (p_ptr->dungeon_idx == DUNGEON_ANGBAND)
628+ if (creature_ptr->dungeon_idx == DUNGEON_ANGBAND)
629629 {
630- if (p_ptr->current_floor_ptr->dun_level > 100)
630+ if (creature_ptr->current_floor_ptr->dun_level > 100)
631631 max_level = MAX_DEPTH - 1;
632- else if (p_ptr->current_floor_ptr->dun_level == 100)
632+ else if (creature_ptr->current_floor_ptr->dun_level == 100)
633633 max_level = 100;
634634 }
635635 else
636636 {
637- max_level = d_info[p_ptr->dungeon_idx].maxdepth;
638- min_level = d_info[p_ptr->dungeon_idx].mindepth;
637+ max_level = d_info[creature_ptr->dungeon_idx].maxdepth;
638+ min_level = d_info[creature_ptr->dungeon_idx].mindepth;
639639 }
640640
641641 /* Prompt */
642642 sprintf(ppp, _("テレポート先:(%d-%d)", "Teleport to level (%d-%d): "), (int)min_level, (int)max_level);
643643
644644 /* Default */
645- sprintf(tmp_val, "%d", (int)p_ptr->current_floor_ptr->dun_level);
645+ sprintf(tmp_val, "%d", (int)creature_ptr->current_floor_ptr->dun_level);
646646
647647 /* Ask for a level */
648648 if (!get_string(ppp, tmp_val, 10)) return;
@@ -668,21 +668,21 @@ static void pattern_teleport(void)
668668 if (autosave_l) do_cmd_save_game(TRUE);
669669
670670 /* Change level */
671- p_ptr->current_floor_ptr->dun_level = command_arg;
671+ creature_ptr->current_floor_ptr->dun_level = command_arg;
672672
673673 leave_quest_check();
674674
675- if (record_stair) exe_write_diary(p_ptr, NIKKI_PAT_TELE, 0, NULL);
675+ if (record_stair) exe_write_diary(creature_ptr, NIKKI_PAT_TELE, 0, NULL);
676676
677- p_ptr->inside_quest = 0;
678- free_turn(p_ptr);
677+ creature_ptr->inside_quest = 0;
678+ free_turn(creature_ptr);
679679
680680 /*
681681 * Clear all saved floors
682682 * and create a first saved floor
683683 */
684684 prepare_change_floor_mode(CFM_FIRST_FLOOR);
685- p_ptr->leaving = TRUE;
685+ creature_ptr->leaving = TRUE;
686686 }
687687
688688 /*!
@@ -727,7 +727,7 @@ static bool pattern_effect(player_type *creature_ptr)
727727 break;
728728
729729 case PATTERN_TILE_TELEPORT:
730- pattern_teleport();
730+ pattern_teleport(creature_ptr);
731731 break;
732732
733733 case PATTERN_TILE_WRECKED:
Show on old repository browser