]> granicus.if.org Git - nethack/commitdiff
fix vision bug - moving a subset of boulders from a location
authornethack.rankin <nethack.rankin>
Sun, 4 Sep 2005 03:06:20 +0000 (03:06 +0000)
committernethack.rankin <nethack.rankin>
Sun, 4 Sep 2005 03:06:20 +0000 (03:06 +0000)
     From a bug report.  Pushing one
boulder from a location which had more than one would open up line of sight
at that spot as if all boulders there were gone.

doc/fixes34.4
src/mkobj.c

index 7aeaf9c853507b95b02cd76e36b3726cae018ac1..90a1a3baec4a54c393d7fddbdc0174df6174ef7c 100644 (file)
@@ -143,6 +143,8 @@ fix grammar for graveyard sounds when polymorphed
 avoid divide by zero crash if Luck drops below -1 while a prayer is in progress
 make hero inflicted with lycanthropy immune to level drain just like monsters
 describe locomotion method accurately when flyers traverse ladders or holes
+when there were multiple boulders at a location, moving one of them sometimes
+       resulted in line-of-sight anomalies
 
 
 Platform- and/or Interface-Specific Fixes
index 9c1be2b580ed6bc94c3aa7b88ed81bf9ad35f869..df05ce12c961fd776b2186a6f07020e122d9d60a 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mkobj.c    3.5     2005/03/26      */
+/*     SCCS Id: @(#)mkobj.c    3.5     2005/09/03      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -1198,6 +1198,7 @@ int x, y;
        panic("place_object: obj not free");
 
     obj_no_longer_held(otmp);
+    /* (could bypass this vision update if there is already a boulder here) */
     if (otmp->otyp == BOULDER) block_point(x,y);       /* vision */
 
     /* obj goes under boulders */
@@ -1349,9 +1350,11 @@ register struct obj *otmp;
 
     if (otmp->where != OBJ_FLOOR)
        panic("remove_object: obj not on floor");
-    if (otmp->otyp == BOULDER) unblock_point(x,y); /* vision */
     extract_nexthere(otmp, &level.objects[x][y]);
     extract_nobj(otmp, &fobj);
+    /* update vision iff this was the only boulder at its spot */
+    if (otmp->otyp == BOULDER && !sobj_at(BOULDER, x, y))
+       unblock_point(x,y); /* vision */
     if (otmp->timed) obj_timer_checks(otmp,x,y,0);
 }