• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionbbb1a2402335d7b11ea898d371933a3ef0c638d5 (tree)
Time2003-07-07 18:42:36
Authormogami <mogami@0568...>
Commitermogami

Log Message

gccのワーニング対策で書き換え。
ループ中で初めて代入される変数を、外で使うと未定義と区別が付かず、
ワーニングが出るので避ける。

Change Summary

Incremental Difference

--- a/src/spells3.c
+++ b/src/spells3.c
@@ -148,7 +148,6 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
148148 int attempts = 500;
149149 int dis = 2;
150150 bool look = TRUE;
151- cave_type *c_ptr;
152151 monster_type *m_ptr = &m_list[m_idx];
153152
154153
@@ -178,6 +177,8 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
178177 /* Try several locations */
179178 for (i = 0; i < 500; i++)
180179 {
180+ cave_type *c_ptr;
181+
181182 /* Pick a (possibly illegal) location */
182183 while (1)
183184 {
@@ -226,7 +227,7 @@ void teleport_monster_to(int m_idx, int ty, int tx, int power)
226227 sound(SOUND_TPOTHER);
227228
228229 /* Update the new location */
229- c_ptr->m_idx = m_idx;
230+ cave[ny][nx].m_idx = m_idx;
230231
231232 /* Update the old location */
232233 cave[oy][ox].m_idx = 0;
@@ -520,7 +521,6 @@ msg_print("
520521 void teleport_level(int m_idx)
521522 {
522523 bool go_up;
523- monster_type *m_ptr;
524524 char m_name[160];
525525 bool see_m = TRUE;
526526
@@ -534,7 +534,7 @@ void teleport_level(int m_idx)
534534 }
535535 else /* To monster */
536536 {
537- m_ptr = &m_list[m_idx];
537+ monster_type *m_ptr = &m_list[m_idx];
538538
539539 /* Get the monster name (or "it") */
540540 monster_desc(m_name, m_ptr, 0);
@@ -683,6 +683,8 @@ void teleport_level(int m_idx)
683683 /* Monster level teleportation is simple deleting now */
684684 if (m_idx > 0)
685685 {
686+ monster_type *m_ptr = &m_list[m_idx];
687+
686688 /* Check for quest completion */
687689 check_quest_completion(m_ptr);
688690
Show on old repository browser