]> granicus.if.org Git - nethack/commitdiff
consistent sokoban guilt for polymorphing boulders
authorcohrs <cohrs>
Thu, 24 Oct 2002 05:43:40 +0000 (05:43 +0000)
committercohrs <cohrs>
Thu, 24 Oct 2002 05:43:40 +0000 (05:43 +0000)
Discussed a while back in the newsgroup.  casting Stone to Flesh on a
Sokoban boulder would affect luck, but simply polymorphing a boulder would not.

src/zap.c

index 0d7f977adbc3d8d13e683cfbb7d7d5f63ceab867..00f87fd3e69b99f62fe7564769bc048e89e25cf9 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -1200,6 +1200,8 @@ poly_obj(obj, id)
        boolean can_merge = (id == STRANGE_OBJECT);
        int obj_location = obj->where;
 
+       if (obj->otyp == BOULDER && In_sokoban(&u.uz))
+           change_luck(-1);    /* Sokoban guilt */
        if (id == STRANGE_OBJECT) { /* preserve symbol */
            int try_limit = 3;
            /* Try up to 3 times to make the magic-or-not status of
@@ -1603,8 +1605,6 @@ struct obj *obj, *otmp;
                    case ROCK_CLASS:    /* boulders and statues */
                        if (obj->otyp == BOULDER) {
                            obj = poly_obj(obj, HUGE_CHUNK_OF_MEAT);
-                           if (In_sokoban(&u.uz))
-                               change_luck(-1);        /* Sokoban guilt */
                            goto smell;
                        } else if (obj->otyp == STATUE) {
                            xchar oox, ooy;