summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2010-01-08 22:55:59 +0100
committerBardur Arantsson <bardur@scientician.net>2010-01-08 23:46:23 +0100
commitf7eb880a91dc00f0531fe6a6ec795fe56ae5fc3f (patch)
tree2c85e919f22ec7c00ecd923266e48ada19c8c126 /src
parent884505957dbd7caf37642e8330e10d0b71d47554 (diff)
Import fix from CVS: Don't generate impassable glass walls.
Diffstat (limited to 'src')
-rw-r--r--src/cave.c13
-rw-r--r--src/cmd2.c2
-rw-r--r--src/externs.h1
-rw-r--r--src/melee2.c4
-rw-r--r--src/spells1.c6
-rw-r--r--src/spells2.c4
-rw-r--r--src/traps.c2
7 files changed, 23 insertions, 9 deletions
diff --git a/src/cave.c b/src/cave.c
index fa65b321..12bedde5 100644
--- a/src/cave.c
+++ b/src/cave.c
@@ -4892,6 +4892,19 @@ void place_floor(int y, int x)
}
/*
+ * This routine is used when the current feature gets convert to a floor and
+ * the possible floor types include glass which is permanent. An unpassable
+ * feature is undesirable, so the glass gets convert to molten glass which
+ * is passable.
+ */
+void place_floor_convert_glass(int y, int x)
+{
+ place_floor(y, x);
+
+ if (cave[y][x].feat == 188) cave[y][x].feat = 217;
+}
+
+/*
* Place a cave filler at (y, x)
*/
void place_filler(int y, int x)
diff --git a/src/cmd2.c b/src/cmd2.c
index 27c64ed7..c962926e 100644
--- a/src/cmd2.c
+++ b/src/cmd2.c
@@ -2162,7 +2162,7 @@ void do_cmd_disarm_mon_trap(int y, int x)
{
msg_print("You disarm the monster trap.");
- place_floor(y, x);
+ place_floor_convert_glass(y, x);
cave[p_ptr->py][p_ptr->px].special = cave[p_ptr->py][p_ptr->px].special2 = 0;
}
diff --git a/src/externs.h b/src/externs.h
index 50ca716b..9cff66f2 100644
--- a/src/externs.h
+++ b/src/externs.h
@@ -673,6 +673,7 @@ extern void wiz_lite_extra(void);
extern void wiz_dark(void);
extern void cave_set_feat(int y, int x, int feat);
extern void place_floor(int y, int x);
+extern void place_floor_convert_glass(int y, int x);
extern void place_filler(int y, int x);
extern void mmove2(int *y, int *x, int y1, int x1, int y2, int x2);
extern bool projectable(int y1, int x1, int y2, int x2);
diff --git a/src/melee2.c b/src/melee2.c
index 291a7d9f..b5e40635 100644
--- a/src/melee2.c
+++ b/src/melee2.c
@@ -6833,7 +6833,7 @@ static void process_monster(int m_idx, bool is_frien)
c_ptr->info &= ~(CAVE_MARK);
/* Break the rune */
- place_floor(ny, nx);
+ place_floor_convert_glass(ny, nx);
/* Allow movement */
do_move = TRUE;
@@ -7068,7 +7068,7 @@ static void process_monster(int m_idx, bool is_frien)
c_ptr->info &= ~(CAVE_MARK);
/* Break the rune */
- place_floor(ny, nx);
+ place_floor_convert_glass(ny, nx);
/* Allow movement */
do_move = TRUE;
diff --git a/src/spells1.c b/src/spells1.c
index 6a4c362f..8f9c38c3 100644
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -3252,7 +3252,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
if (f)
{
- if (f == FEAT_FLOOR) place_floor(y, x);
+ if (f == FEAT_FLOOR) place_floor_convert_glass(y, x);
else cave_set_feat(y, x, f);
if (seen) obvious = TRUE;
@@ -3341,7 +3341,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
/* Remove the feature */
if (!(f_info[c_ptr->feat].flags1 & FF1_PERMANENT))
- place_floor(y, x);
+ place_floor_convert_glass(y, x);
}
/* Hack -- Force redraw */
@@ -3411,7 +3411,7 @@ static bool project_f(int who, int r, int y, int x, int dam, int typ)
/* Remove the feature */
if (!(f_info[c_ptr->feat].flags1 & FF1_PERMANENT))
- place_floor(y, x);
+ place_floor_convert_glass(y, x);
/* Hack -- Force redraw */
note_spot(y, x);
diff --git a/src/spells2.c b/src/spells2.c
index 06f5b443..2e409713 100644
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -5520,7 +5520,7 @@ void wipe(int y1, int x1, int r)
if (m_list[c_ptr->m_idx].status != MSTATUS_COMPANION) delete_monster(y, x);
delete_object(y, x);
- place_floor(y, x);
+ place_floor_convert_glass(y, x);
}
}
@@ -7914,7 +7914,7 @@ bool passwall(int dir, bool safe)
msg_print("You emerge in the wall!");
take_hit(damroll(10, 8), "becoming one with a wall");
}
- place_floor(y, x);
+ place_floor_convert_glass(y, x);
}
/* Move */
diff --git a/src/traps.c b/src/traps.c
index d387efea..3e9b2497 100644
--- a/src/traps.c
+++ b/src/traps.c
@@ -3418,7 +3418,7 @@ bool mon_hit_trap(int m_idx)
}
/* Remove the trap if inactive now */
- if (remove) place_floor(my, mx);
+ if (remove) place_floor_convert_glass(my, mx);
/* did it die? */
return (dead);