• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisiona00725f646a13e2023ab03736b8385fa8c3c479f (tree)
Time2019-06-20 21:16:52
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -504,8 +504,7 @@ void do_cmd_search(player_type * creature_ptr)
504504 }
505505 take_turn(creature_ptr, 100);
506506
507- /* Search */
508- search();
507+ search(creature_ptr);
509508 }
510509
511510
@@ -1189,7 +1188,7 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
11891188 /* We may continue chopping */
11901189 msg_format(_("%sを切っている。", "You chop away at the %s."), name);
11911190 /* Occasional Search XXX XXX */
1192- if (randint0(100) < 25) search();
1191+ if (randint0(100) < 25) search(p_ptr);
11931192 }
11941193 else
11951194 {
@@ -1204,7 +1203,7 @@ static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
12041203 if (is_hidden_door(g_ptr))
12051204 {
12061205 /* Occasional Search XXX XXX */
1207- if (randint0(100) < 25) search();
1206+ if (randint0(100) < 25) search(p_ptr);
12081207 }
12091208 return more;
12101209 }
--- a/src/player-move.c
+++ b/src/player-move.c
@@ -229,17 +229,17 @@ static void discover_hidden_things(POSITION y, POSITION x)
229229 * @brief プレイヤーの探索処理判定
230230 * @return なし
231231 */
232-void search(void)
232+void search(player_type *creature_ptr)
233233 {
234234 DIRECTION i;
235235 PERCENTAGE chance;
236236
237237 /* Start with base search ability */
238- chance = p_ptr->skill_srh;
238+ chance = creature_ptr->skill_srh;
239239
240240 /* Penalize various conditions */
241- if (p_ptr->blind || no_lite()) chance = chance / 10;
242- if (p_ptr->confused || p_ptr->image) chance = chance / 10;
241+ if (creature_ptr->blind || no_lite()) chance = chance / 10;
242+ if (creature_ptr->confused || creature_ptr->image) chance = chance / 10;
243243
244244 /* Search the nearby grids, which are always in bounds */
245245 for (i = 0; i < 9; ++ i)
@@ -247,7 +247,7 @@ void search(void)
247247 /* Sometimes, notice things */
248248 if (randint0(100) < chance)
249249 {
250- discover_hidden_things(p_ptr->y + ddy_ddd[i], p_ptr->x + ddx_ddd[i]);
250+ discover_hidden_things(creature_ptr->y + ddy_ddd[i], creature_ptr->x + ddx_ddd[i]);
251251 }
252252 }
253253 }
@@ -702,13 +702,13 @@ bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
702702 /* Spontaneous Searching */
703703 if ((p_ptr->skill_fos >= 50) || (0 == randint0(50 - p_ptr->skill_fos)))
704704 {
705- search();
705+ search(p_ptr);
706706 }
707707
708708 /* Continuous Searching */
709709 if (p_ptr->action == ACTION_SEARCH)
710710 {
711- search();
711+ search(p_ptr);
712712 }
713713 }
714714
--- a/src/player-move.h
+++ b/src/player-move.h
@@ -23,7 +23,7 @@ extern bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode);
2323 extern void py_pickup_aux(OBJECT_IDX o_idx);
2424 extern bool pattern_seq(POSITION c_y, POSITION c_x, POSITION n_y, POSITION n_x);
2525 extern bool trap_can_be_ignored(FEAT_IDX feat);
26-extern void search(void);
26+extern void search(player_type *creature_ptr);
2727 extern void carry(bool pickup);
2828 #ifdef TRAVEL
2929 extern void do_cmd_travel(void);
Show on old repository browser