• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: コミット

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


コミットメタ情報

リビジョン9c267fcdccceebdf334f3ec02f6939e38e55d1e2 (tree)
日時2019-10-16 20:20:12
作者deskull <deskull@user...>
コミッターdeskull

ログメッセージ

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

変更サマリ

差分

--- a/src/cmd/cmd-activate.c
+++ b/src/cmd/cmd-activate.c
@@ -1611,7 +1611,7 @@ bool activate_artifact(player_type *user_ptr, object_type *o_ptr)
16111611 teleport_player(222, 0L);
16121612 break;
16131613 case 11: case 12:
1614- (void)stair_creation();
1614+ (void)stair_creation(user_ptr);
16151615 break;
16161616 default:
16171617 if (get_check(_("この階を去りますか?", "Leave this level? ")))
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -327,7 +327,7 @@ concptr do_nature_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode
327327 {
328328 if (cast)
329329 {
330- stair_creation();
330+ stair_creation(caster_ptr);
331331 }
332332 }
333333 break;
--- a/src/spells-floor.c
+++ b/src/spells-floor.c
@@ -263,8 +263,9 @@ bool place_mirror(void)
263263 * Create stairs at or move previously created stairs into the player location.
264264 * @return なし
265265 */
266-void stair_creation(void)
266+void stair_creation(player_type *caster_ptr)
267267 {
268+ floor_type *floor_ptr = caster_ptr->current_floor_ptr;
268269 saved_floor_type *sf_ptr;
269270 saved_floor_type *dest_sf_ptr;
270271
@@ -277,10 +278,10 @@ void stair_creation(void)
277278 if (ironman_downward) up = FALSE;
278279
279280 /* Forbid down staircases on quest level */
280- if (quest_number(p_ptr->current_floor_ptr->dun_level) || (p_ptr->current_floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE;
281+ if (quest_number(floor_ptr->dun_level) || (floor_ptr->dun_level >= d_info[p_ptr->dungeon_idx].maxdepth)) down = FALSE;
281282
282283 /* No effect out of standard dungeon floor */
283- if (!p_ptr->current_floor_ptr->dun_level || (!up && !down) ||
284+ if (!floor_ptr->dun_level || (!up && !down) ||
284285 (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) ||
285286 p_ptr->inside_arena || p_ptr->phase_out)
286287 {
@@ -331,11 +332,11 @@ void stair_creation(void)
331332 {
332333 POSITION x, y;
333334
334- for (y = 0; y < p_ptr->current_floor_ptr->height; y++)
335+ for (y = 0; y < floor_ptr->height; y++)
335336 {
336- for (x = 0; x < p_ptr->current_floor_ptr->width; x++)
337+ for (x = 0; x < floor_ptr->width; x++)
337338 {
338- grid_type *g_ptr = &p_ptr->current_floor_ptr->grid_array[y][x];
339+ grid_type *g_ptr = &floor_ptr->grid_array[y][x];
339340
340341 if (!g_ptr->special) continue;
341342 if (feat_uses_special(g_ptr->feat)) continue;
@@ -368,19 +369,19 @@ void stair_creation(void)
368369 if (up)
369370 {
370371 cave_set_feat(p_ptr->y, p_ptr->x,
371- (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= p_ptr->current_floor_ptr->dun_level - 2)) ?
372+ (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level <= floor_ptr->dun_level - 2)) ?
372373 feat_state(feat_up_stair, FF_SHAFT) : feat_up_stair);
373374 }
374375 else
375376 {
376377 cave_set_feat(p_ptr->y, p_ptr->x,
377- (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= p_ptr->current_floor_ptr->dun_level + 2)) ?
378+ (dest_sf_ptr->last_visit && (dest_sf_ptr->dun_level >= floor_ptr->dun_level + 2)) ?
378379 feat_state(feat_down_stair, FF_SHAFT) : feat_down_stair);
379380 }
380381
381382
382383 /* Connect this stairs to the destination */
383- p_ptr->current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
384+ floor_ptr->grid_array[p_ptr->y][p_ptr->x].special = dest_floor_id;
384385 }
385386
386387 /*
--- a/src/spells-floor.h
+++ b/src/spells-floor.h
@@ -5,7 +5,7 @@ extern void wiz_dark(void);
55 extern bool warding_glyph(player_type *caster_ptr);
66 extern bool explosive_rune(void);
77 extern bool place_mirror(void);
8-extern void stair_creation(void);
8+extern void stair_creation(player_type *caster_ptr);
99 extern void map_area(POSITION range);
1010 extern bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate);
1111 extern bool earthquake(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx);
旧リポジトリブラウザで表示