]> granicus.if.org Git - nethack/commitdiff
Eyes plus stinking cloud
authorcohrs <cohrs>
Thu, 21 Sep 2006 15:03:48 +0000 (15:03 +0000)
committercohrs <cohrs>
Thu, 21 Sep 2006 15:03:48 +0000 (15:03 +0000)
stinking clouds extend their timers, causing the "ttl == 0" check in
visible_region_at to be inappropriate; technically it was never quite
right, since the ttl is set to 0 one turn before removal is considered. But
with the Eyes on, this caused a visible change in the region although the
region still existed.  Introduced a new -2L value to designate that the
region is being removed (-1L means it's permanent), which is what
visible_region_at was really trying to test.

doc/fixes34.4
src/region.c

index c0d0467d573a1a3563f2258ea2aa1747a853a575..796ad2a9fa4b8cb2cec886bf58d63191d136b094 100644 (file)
@@ -255,6 +255,8 @@ hero is not subject to light-based blindness while fainted from hunger
 engraving while underwater should use surface() which handles that case
 prevent obj_is_local panic during bones creation when splatter_burning_oil()
        from a thrown potion of oil kills the hero
+fix region timeout detection, caused strange display of stinking cloud
+       while wearing the Eyes of the Overworld
 
 
 Platform- and/or Interface-Specific Fixes
index 4aa3761ab24861a798cb0b5edb2aeaa7967ddc30..863c4ff7d42f711c4010918c8a57fa086295a96c 100644 (file)
@@ -339,6 +339,7 @@ NhRegion *reg;
        return;
 
     /* Update screen if necessary */
+    reg->ttl = -2L;                    /* for visible_region_at */
     if (reg->visible)
        for (x = reg->bounding_box.lx; x <= reg->bounding_box.hx; x++)
            for (y = reg->bounding_box.ly; y <= reg->bounding_box.hy; y++)
@@ -600,7 +601,7 @@ xchar x, y;
 
     for (i = 0; i < n_regions; i++)
        if (inside_region(regions[i], x, y) && regions[i]->visible &&
-               regions[i]->ttl != 0L)
+               regions[i]->ttl != -2L)
            return regions[i];
     return (NhRegion *) 0;
 }