called in mon.c */
| 232 | |
| 233 | /* called in mon.c */ |
| 234 | void |
| 235 | shkgone(struct monst *mtmp) |
| 236 | { |
| 237 | struct eshk *eshk = ESHK(mtmp); |
| 238 | struct mkroom *sroom = &svr.rooms[eshk->shoproom - ROOMOFFSET]; |
| 239 | struct obj *otmp; |
| 240 | char *p; |
| 241 | int sx, sy; |
| 242 | |
| 243 | /* [BUG: some of this should be done on the shop level */ |
| 244 | /* even when the shk dies on a different level.] */ |
| 245 | if (on_level(&eshk->shoplevel, &u.uz)) { |
| 246 | discard_damage_owned_by(mtmp); |
| 247 | sroom->resident = (struct monst *) 0; |
| 248 | if (!search_special(ANY_SHOP)) |
| 249 | svl.level.flags.has_shop = 0; |
| 250 | |
| 251 | /* items on shop floor revert to ordinary objects */ |
| 252 | for (sx = sroom->lx; sx <= sroom->hx; sx++) |
| 253 | for (sy = sroom->ly; sy <= sroom->hy; sy++) |
| 254 | for (otmp = svl.level.objects[sx][sy]; otmp; |
| 255 | otmp = otmp->nexthere) |
| 256 | otmp->no_charge = 0; |
| 257 | |
| 258 | /* Make sure bill is set only when the |
| 259 | dead shk is the resident shk. */ |
| 260 | if ((p = strchr(u.ushops, eshk->shoproom)) != 0) { |
| 261 | setpaid(mtmp); |
| 262 | eshk->bill_p = (struct bill_x *) 0; |
| 263 | /* remove eshk->shoproom from u.ushops */ |
| 264 | do { |
| 265 | *p = *(p + 1); |
| 266 | } while (*++p); |
| 267 | } |
| 268 | } |
| 269 | } |
| 270 | |
| 271 | void |
| 272 | set_residency(struct monst *shkp, boolean zero_out) |
no test coverage detected