]> granicus.if.org Git - nethack/commitdiff
R853 - Items inside statues lost
authorcohrs <cohrs>
Mon, 8 Jul 2002 00:15:27 +0000 (00:15 +0000)
committercohrs <cohrs>
Mon, 8 Jul 2002 00:15:27 +0000 (00:15 +0000)
If you cast stone to flesh on a statue on a location containing a monster,
the statue would be turned into a corpse and the contents lost.  This
didn't seem to be appropriate for the spell.  Now the contents spill out.

doc/fixes34.1
src/zap.c

index ca69060638c7118207a1fd4f068a03825b98d954..17d696a5ff711ad92210e8e7719910b682e503f3 100644 (file)
@@ -149,6 +149,8 @@ eating various rotten food items would not break vegan/vegetarian conduct
 unaligned special levels should inherit alignment from the dungeon
 Samurai quest was missing several doors
 Cancelled while polymorphed and Unchanging should provide feedback
+stone to flesh on a statue with contents would lose the contents if a
+       monster was on the same location as the statue
 
 
 Platform- and/or Interface-Specific Fixes
index 6ddcfca1f3b9d30bab7c0f4c08b76e2538210ea0..deee40c82481e77da1aa6ad2b10fea3a27da2dfd 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1600,6 +1600,7 @@ struct obj *obj, *otmp;
                            (void) get_obj_location(obj, &oox, &ooy, 0);
                            if (!animate_statue(obj, oox, ooy,
                                                ANIMATE_SPELL, (int *)0)) {
+                               struct obj *item;
 makecorpse:                    if (mons[obj->corpsenm].geno &
                                                        (G_NOCORPSE|G_UNIQ)) {
                                    res = 0;
@@ -1607,7 +1608,12 @@ makecorpse:                      if (mons[obj->corpsenm].geno &
                                }
                                /* Unlikely to get here since genociding
                                 * monsters also sets the G_NOCORPSE flag.
+                                * Drop the contents, poly_obj looses them.
                                 */
+                               while ((item = obj->cobj) != 0) {
+                                   obj_extract_self(item);
+                                   place_object(item, obj->ox, obj->oy);
+                               }
                                obj = poly_obj(obj, CORPSE);
                                break;
                            }