Factor out a new is_moat function.

The fact that Juiblex's swamp is MOAT but not moat is weird and should
probably be looked at at some point.
This commit is contained in:
Sean Hunt
2015-02-23 14:59:24 -05:00
parent 6fd30ab1ce
commit 5ffd5a3000
4 changed files with 34 additions and 16 deletions

View File

@@ -4017,7 +4017,7 @@ short exploding_wand_typ;
case ZT_COLD:
if (is_pool(x,y) || is_lava(x,y)) {
boolean lava = is_lava(x,y);
const char *moat = waterbody_name(x, y);
boolean moat = is_moat(x,y);
if (lev->typ == WATER) {
/* For now, don't let WATER freeze. */
@@ -4041,8 +4041,9 @@ short exploding_wand_typ;
if (see_it) {
if(lava)
Norep("The lava cools and solidifies.");
else if(strcmp(moat, "moat") == 0)
Norep("The %s is bridged with ice!", moat);
else if(moat)
Norep("The %s is bridged with ice!",
waterbody_name(x,y));
else
Norep("The water freezes.");
newsym(x,y);