This commit is contained in:
jl777
2019-02-02 04:36:12 -11:00
parent 6d73c8c032
commit 046de18981

View File

@@ -120,7 +120,7 @@ do_chase(struct rogue_state *rs,THING *th)
register bool stoprun = FALSE; /* TRUE means we are there */ register bool stoprun = FALSE; /* TRUE means we are there */
register bool door; register bool door;
register THING *obj; register THING *obj;
static coord this; /* Temporary destination for chaser */ static coord DEST; /* Temporary destination for chaser */
rer = th->t_room; /* Find room of chaser */ rer = th->t_room; /* Find room of chaser */
if (on(*th, ISGREED) && rer->r_goldval == 0) if (on(*th, ISGREED) && rer->r_goldval == 0)
@@ -146,7 +146,7 @@ over:
curdist = dist_cp(th->t_dest, cp); curdist = dist_cp(th->t_dest, cp);
if (curdist < mindist) if (curdist < mindist)
{ {
this = *cp; DEST = *cp;
mindist = curdist; mindist = curdist;
} }
} }
@@ -159,7 +159,7 @@ over:
} }
else else
{ {
this = *th->t_dest; DEST = *th->t_dest;
/* /*
* For dragons check and see if (a) the hero is on a straight * For dragons check and see if (a) the hero is on a straight
* line from it, and (b) that it is within shooting distance, * line from it, and (b) that it is within shooting distance,
@@ -191,13 +191,13 @@ over:
* so we run to it. If we hit it we either want to fight it * so we run to it. If we hit it we either want to fight it
* or stop running * or stop running
*/ */
if (!chase(th, &this)) if (!chase(th, &DEST))
{ {
if (ce(this, hero)) if (ce(DEST, hero))
{ {
return( attack(rs,th) ); return( attack(rs,th) );
} }
else if (ce(this, *th->t_dest)) else if (ce(DEST, *th->t_dest))
{ {
for (obj = lvl_obj; obj != NULL; obj = next(obj)) for (obj = lvl_obj; obj != NULL; obj = next(obj))
if (th->t_dest == &obj->o_pos) if (th->t_dest == &obj->o_pos)