From d8591be858cefceef4db2c159dba14efe9d4c28f Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 6 Jan 2016 17:57:39 -0800 Subject: [PATCH] fix #4138 - 'text bug' for freezing moat Freezing a moat--unlike other types of water--substitutes the type of water (because that isn't "moat" for Medusa's level) in the freeze message but was doing so after changing the affected terrain to ICE, yielding "The ice is bridged with ice." --- doc/fixes36.1 | 1 + src/zap.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 2602460c0..12386fc24 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -97,6 +97,7 @@ make vault guard accept names starting with number fix weight of containers in special levels make the raven medusa level shortsighted fix possible segfault in lev_comp when map was too tall +fix "the ice is bridged with ice" when freezing castle's moat or Medusa's sea Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 0749c8dbf..6a695fbac 100644 --- a/src/zap.c +++ b/src/zap.c @@ -4234,8 +4234,8 @@ short exploding_wand_typ; case ZT_COLD: if (is_pool(x, y) || is_lava(x, y)) { - boolean lava = is_lava(x, y); - boolean moat = is_moat(x, y); + boolean lava = is_lava(x, y), + moat = is_moat(x, y); if (lev->typ == WATER) { /* For now, don't let WATER freeze. */ @@ -4245,23 +4245,25 @@ short exploding_wand_typ; You_hear("a soft crackling."); rangemod -= 1000; /* stop */ } else { + char buf[BUFSZ]; + + Strcpy(buf, waterbody_name(x, y)); /* for MOAT */ rangemod -= 3; if (lev->typ == DRAWBRIDGE_UP) { lev->drawbridgemask &= ~DB_UNDER; /* clear lava */ lev->drawbridgemask |= (lava ? DB_FLOOR : DB_ICE); } else { if (!lava) - lev->icedpool = - (lev->typ == POOL ? ICED_POOL : ICED_MOAT); - lev->typ = (lava ? ROOM : ICE); + lev->icedpool = (lev->typ == POOL) ? ICED_POOL + : ICED_MOAT; + lev->typ = lava ? ROOM : ICE; } bury_objs(x, y); if (see_it) { if (lava) Norep("The lava cools and solidifies."); else if (moat) - Norep("The %s is bridged with ice!", - waterbody_name(x, y)); + Norep("The %s is bridged with ice!", buf); else Norep("The water freezes."); newsym(x, y); -- 2.50.1