OSDN Git Service

テレポート先候補が1マスしかない場合にcur_candidates == 0の状態で全候
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 8 Feb 2004 14:51:11 +0000 (14:51 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Sun, 8 Feb 2004 14:51:11 +0000 (14:51 +0000)
補の50%以上と見なされ, ダンジョンの外壁を含む不正な位置にテレポートし
て変愚蛮怒が落ちる場合があるバグを修正. また, teleport_player_aux()で
の2番目のcave_player_teleportable_bold()の引数nonmagicalがFALSE固定
だったバグを修正.

src/spells3.c

index 2a0da69..ebc6033 100644 (file)
@@ -379,7 +379,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
                cur_candidates += candidates_at[min];
 
                /* 50% of all candidates will have an equal chance to be choosen. */
-               if (cur_candidates >= total_candidates / 2) break;
+               if (cur_candidates && (cur_candidates >= total_candidates / 2)) break;
        }
 
        /* Pick up a single location randomly */
@@ -393,7 +393,7 @@ bool teleport_player_aux(int dis, bool passive, bool nonmagical)
                        int d;
 
                        /* Skip illegal locations */
-                       if (!cave_player_teleportable_bold(y, x, passive, FALSE)) continue;
+                       if (!cave_player_teleportable_bold(y, x, passive, nonmagical)) continue;
 
                        /* Calculate distance */
                        d = distance(py, px, y, x);