release the objects the creature is carrying */
| 872 | |
| 873 | /* release the objects the creature is carrying */ |
| 874 | void |
| 875 | relobj( |
| 876 | struct monst *mtmp, |
| 877 | int show, |
| 878 | boolean is_pet) /* If true, pet should keep wielded/worn items */ |
| 879 | { |
| 880 | struct obj *otmp; |
| 881 | int omx = mtmp->mx, omy = mtmp->my; |
| 882 | |
| 883 | /* vault guard's gold goes away rather than be dropped... */ |
| 884 | if (mtmp->isgd && (otmp = findgold(mtmp->minvent)) != 0) { |
| 885 | if (canspotmon(mtmp)) |
| 886 | pline("%s gold %s.", s_suffix(Monnam(mtmp)), |
| 887 | canseemon(mtmp) ? "vanishes" : "seems to vanish"); |
| 888 | obj_extract_self(otmp); |
| 889 | obfree(otmp, (struct obj *) 0); |
| 890 | } /* isgd && has gold */ |
| 891 | |
| 892 | while ((otmp = (is_pet ? droppables(mtmp) : mtmp->minvent)) != 0) { |
| 893 | mdrop_obj(mtmp, otmp, is_pet && flags.verbose); |
| 894 | } |
| 895 | |
| 896 | if (show && cansee(omx, omy)) |
| 897 | newsym(omx, omy); |
| 898 | } |
| 899 | |
| 900 | /*steal.c*/ |
no test coverage detected