MCPcopy Index your code
hub / github.com/NetHack/NetHack / relobj

Function relobj

src/steal.c:874–898  ·  view source on GitHub ↗

release the objects the creature is carrying */

Source from the content-addressed store, hash-verified

872
873/* release the objects the creature is carrying */
874void
875relobj(
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*/

Callers 3

grddeadFunction · 0.85
dog_inventFunction · 0.85
m_detachFunction · 0.85

Calls 10

findgoldFunction · 0.85
s_suffixFunction · 0.85
MonnamFunction · 0.85
canseemonFunction · 0.85
obj_extract_selfFunction · 0.85
obfreeFunction · 0.85
droppablesFunction · 0.85
mdrop_objFunction · 0.85
newsymFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected