diff --git a/include/extern.h b/include/extern.h index 8fa5aa9b3..c3f64a34b 100644 --- a/include/extern.h +++ b/include/extern.h @@ -3786,6 +3786,7 @@ extern boolean worm_cross(int, int, int, int); extern int wseg_at(struct monst *, int, int) NO_NNARGS; extern void flip_worm_segs_vertical(struct monst *, int, int) NONNULLARG1; extern void flip_worm_segs_horizontal(struct monst *, int, int) NONNULLARG1; +extern void redraw_worm(struct monst *); /* ### worn.c ### */ diff --git a/src/dog.c b/src/dog.c index 6134355f9..21d18d89f 100644 --- a/src/dog.c +++ b/src/dog.c @@ -1203,6 +1203,8 @@ tamedog(struct monst *mtmp, struct obj *obj, boolean givemsg) Hallucination ? "approachable" : "friendly"); newsym(mtmp->mx, mtmp->my); + if (mtmp->wormno) + redraw_worm(mtmp); if (attacktype(mtmp->data, AT_WEAP)) { mtmp->weapon_check = NEED_HTH_WEAPON; (void) mon_wield_item(mtmp); @@ -1311,8 +1313,12 @@ abuse_dog(struct monst *mtmp) else growl(mtmp); /* give them a moment's worry */ - if (!mtmp->mtame) + if (!mtmp->mtame) { newsym(mtmp->mx, mtmp->my); + if (mtmp->wormno) { + redraw_worm(mtmp); + } + } } } diff --git a/src/worm.c b/src/worm.c index bb95dc4d5..4b28790cd 100644 --- a/src/worm.c +++ b/src/worm.c @@ -988,4 +988,15 @@ flip_worm_segs_horizontal(struct monst *worm, int minx, int maxx) } } +void +redraw_worm(struct monst *worm) +{ + struct wseg *curr = wtails[worm->wormno]; + + while (curr) { + newsym(curr->wx, curr->wy); + curr = curr->nseg; + } +} + /*worm.c*/