diff --git a/doc/fixes34.2 b/doc/fixes34.2 index 652181efe..c56e03ea4 100644 --- a/doc/fixes34.2 +++ b/doc/fixes34.2 @@ -120,6 +120,8 @@ refine cmdassist handling for grid bugs when casting force bolt spell while engulfed go ahead and use the engulfers name in the hit message rather than "it" a fog cloud shouldn't pummel you with debris +do not let an attached iron ball drag the hero through a location that the hero + could not move normally Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 23f72db83..50f505f6e 100644 --- a/src/zap.c +++ b/src/zap.c @@ -2782,6 +2782,32 @@ struct obj *obj; /* object tossed/used */ break; /* physical objects fall onto sink */ #endif } + /* limit range of ball so hero won't make an invalid move */ + if (weapon == THROWN_WEAPON && range > 0 && + obj->otyp == HEAVY_IRON_BALL) { + struct obj *bobj; + struct trap *t; + if ((bobj = sobj_at(BOULDER, x, y)) != 0) { + if (cansee(x,y)) + pline("%s hits %s.", + The(distant_name(obj, xname)), an(xname(bobj))); + range = 0; + } else if (obj == uball) { + if (!test_move(x - ddx, y - ddy, ddx, ddy, TEST_MOVE)) { + /* nb: it didn't hit anything directly */ + if (cansee(x,y)) + pline("%s jerks to an abrupt halt.", + The(distant_name(obj, xname))); /* lame */ + range = 0; + } else if (In_sokoban(&u.uz) && (t = t_at(x, y)) != 0 && + (t->ttyp == PIT || t->ttyp == SPIKED_PIT || + t->ttyp == HOLE || t->ttyp == TRAPDOOR)) { + /* hero falls into the trap, so ball stops */ + range = 0; + } + } + } + /* thrown/kicked missile has moved away from its starting spot */ point_blank = FALSE; /* affects passing through iron bars */ }