MCPcopy Create free account
hub / github.com/NetHack/NetHack / docall_xname

Function docall_xname

src/do_name.c:604–633  ·  view source on GitHub ↗

for use by safe_qbuf() */

Source from the content-addressed store, hash-verified

602
603/* for use by safe_qbuf() */
604staticfn char *
605docall_xname(struct obj *obj)
606{
607 struct obj otemp;
608
609 otemp = *obj;
610 otemp.oextra = (struct oextra *) 0;
611 otemp.quan = 1L;
612 /* in case water is already known, convert "[un]holy water" to "water" */
613 otemp.blessed = otemp.cursed = 0;
614 /* remove attributes that are doname() caliber but get formatted
615 by xname(); most of these fixups aren't really needed because the
616 relevant type of object isn't callable so won't reach this far */
617 if (otemp.oclass == WEAPON_CLASS)
618 otemp.opoisoned = 0; /* not poisoned */
619 else if (otemp.oclass == POTION_CLASS)
620 otemp.odiluted = 0; /* not diluted */
621 else if (otemp.otyp == TOWEL || otemp.otyp == STATUE)
622 otemp.spe = 0; /* not wet or historic */
623 else if (otemp.otyp == TIN)
624 otemp.known = 0; /* suppress tin type (homemade, &c) and mon type */
625 else if (otemp.otyp == FIGURINE)
626 otemp.corpsenm = NON_PM; /* suppress mon type */
627 else if (otemp.otyp == HEAVY_IRON_BALL)
628 otemp.owt = objects[HEAVY_IRON_BALL].oc_weight; /* not "very heavy" */
629 else if (otemp.oclass == FOOD_CLASS && otemp.globby)
630 otemp.owt = 120; /* 6*20, neither a small glob nor a large one */
631
632 return an(xname(&otemp));
633}
634
635void
636docall(struct obj *obj)

Callers

nothing calls this directly

Calls 2

anFunction · 0.85
xnameFunction · 0.85

Tested by

no test coverage detected