OSDN Git Service

練気術を使用した直後に盲目になった状況で, その練気術を'n'や'['で繰り
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 19 Jul 2003 13:21:29 +0000 (13:21 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sat, 19 Jul 2003 13:21:29 +0000 (13:21 +0000)
返して使用しようとするとrepeat_pull()でのスタックの読み出し順序が狂
い, get_mind_power()が呪文番号INVEN_FORCEを返し, その結果配列外アクセ
スを起こしたりMPが異常な値になったりしていたので, get_mind_power()で
repeat_pull()された呪文番号がINVEN_FORCEだった場合はもう1度だけ
repeat_pull()して正しい呪文番号を取得するように仮修正. その場しのぎに
過ぎないので, 後で別の方法を考える必要はある.

src/mind.c

index f01766e..839bdfb 100644 (file)
@@ -524,15 +524,18 @@ void mindcraft_info(char *p, int use_mind, int power)
 
 #ifdef ALLOW_REPEAT /* TNB */
 
-      /* Get the spell, if available */
-      if (repeat_pull(sn))
+       /* Get the spell, if available */
+       if (repeat_pull(sn))
        {
-         /* Verify the spell */
-         if (mind_ptr->info[*sn].min_lev <= plev)
-           {
-             /* Success */
-             return (TRUE);
-           }
+               /* Hack -- If requested INVEN_FORCE(1111), pull again */
+               if (*sn == INVEN_FORCE) repeat_pull(sn);
+
+               /* Verify the spell */
+               if (mind_ptr->info[*sn].min_lev <= plev)
+               {
+                       /* Success */
+                       return (TRUE);
+               }
        }
 
 #endif /* ALLOW_REPEAT -- TNB */