From: nothere Date: Sun, 8 Feb 2004 14:51:11 +0000 (+0000) Subject: テレポート先候補が1マスしかない場合にcur_candidates == 0の状態で全候 X-Git-Tag: v2.1.2~581 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4c9ee2c0245be98c0e781c984da2954fc2e44041;p=hengbandforosx%2Fhengbandosx.git テレポート先候補が1マスしかない場合にcur_candidates == 0の状態で全候 補の50%以上と見なされ, ダンジョンの外壁を含む不正な位置にテレポートし て変愚蛮怒が落ちる場合があるバグを修正. また, teleport_player_aux()で の2番目のcave_player_teleportable_bold()の引数nonmagicalがFALSE固定 だったバグを修正. --- diff --git a/src/spells3.c b/src/spells3.c index 2a0da695e..ebc603394 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -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);