]> granicus.if.org Git - nethack/commitdiff
dismounting next to a boulder
authorcohrs <cohrs>
Fri, 26 Sep 2003 03:31:09 +0000 (03:31 +0000)
committercohrs <cohrs>
Fri, 26 Sep 2003 03:31:09 +0000 (03:31 +0000)
It makes sense that if you cannot normally move to a location containing a
boulder, dismounting there should be avoided if possible.  It seems
that it should be possible to land there if there's no other choice.
Perhaps doing so should result in damage, but that's not in this patch.

doc/fixes34.3
src/steed.c

index b68347c80eb7716b5e82dfc7fbb37af70815ba52..4a998e193f4c674259e5b4016b3ff644f258de40 100644 (file)
@@ -30,6 +30,7 @@ do not double credit when putting gold into an unpaid container
 manes are nonliving
 poles and grappling hook worked thru walls when wearing Eyes of the Overworld
 more tweaks to fog cloud behavior
+when dismounting by choice and unimpaired, try not to land on a boulder
 
 
 Platform- and/or Interface-Specific Fixes
index 1395767afcf5337cecd5facff06c13c7627fad76..25ec9f8a22c11276351d176ea3b679f99fdd8a82 100644 (file)
@@ -424,7 +424,7 @@ int forceit;
     boolean found = FALSE;
     struct trap *t;
 
-    /* avoid known traps (i == 0), but allow them as a backup */
+    /* avoid known traps (i == 0) and boulders, but allow them as a backup */
     if (reason != DISMOUNT_BYCHOICE || Stunned || Confusion || Fumbling) i = 1;
     for (; !found && i < 2; ++i) {
        for (x = u.ux-1; x <= u.ux+1; x++)
@@ -436,7 +436,9 @@ int forceit;
                    distance = distu(x,y);
                    if (min_distance < 0 || distance < min_distance ||
                            (distance == min_distance && rn2(2))) {
-                       if (i > 0 || (t = t_at(x, y)) == 0 || !t->tseen) {
+                       if (i > 0 || (((t = t_at(x, y)) == 0 || !t->tseen) &&
+                                     (!sobj_at(BOULDER, x, y) ||
+                                      throws_rocks(youmonst.data)))) {
                            spot->x = x;
                            spot->y = y;
                            min_distance = distance;