fix "couldn't place lregion type 5"
Implement a fix for the problem From a bug report: if the destination position on the Plane of Fire has a randomly placed trap on it, you'd get an impossibility warning of "couldn't place lregion type 5" (and then arrive successfully at the target spot anyway). As his investigation indicated, the code to remove such traps wasn't being reached because the `bad_location' check yields true for trapped spots.
This commit is contained in:
@@ -52,6 +52,7 @@ avoid temporary disappearing Burdened message due to updating status line
|
||||
midway thru in_container
|
||||
don't credit player's wisdom when makelevel creates random Elbereth engravings
|
||||
reduce insect/monster creation from monster spells
|
||||
avoid "couldn't place lregion type 5" warning when arriving at Plane of Fire
|
||||
|
||||
|
||||
Platform- and/or Interface-Specific Fixes
|
||||
|
||||
21
src/mkmaze.c
21
src/mkmaze.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)mkmaze.c 3.4 2002/03/12 */
|
||||
/* SCCS Id: @(#)mkmaze.c 3.4 2002/04/04 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -288,13 +288,18 @@ xchar rtype;
|
||||
boolean oneshot;
|
||||
d_level *lev;
|
||||
{
|
||||
if (bad_location(x, y, nlx, nly, nhx, nhy)) return FALSE;
|
||||
if (oneshot) {
|
||||
/* must make due with the only location possible */
|
||||
/* avoid failure due to a misplaced trap */
|
||||
/* it might still fail if there's a dungeon feature here */
|
||||
struct trap *t = t_at(x,y);
|
||||
if (t) deltrap(t);
|
||||
if (bad_location(x, y, nlx, nly, nhx, nhy)) {
|
||||
if (!oneshot) {
|
||||
return FALSE; /* caller should try again */
|
||||
} else {
|
||||
/* Must make due with the only location possible;
|
||||
avoid failure due to a misplaced trap.
|
||||
It might still fail if there's a dungeon feature here. */
|
||||
struct trap *t = t_at(x,y);
|
||||
|
||||
if (t && t->ttyp != MAGIC_PORTAL) deltrap(t);
|
||||
if (bad_location(x, y, nlx, nly, nhx, nhy)) return FALSE;
|
||||
}
|
||||
}
|
||||
switch (rtype) {
|
||||
case LR_TELE:
|
||||
|
||||
Reference in New Issue
Block a user