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

Function onbill

src/shk.c:1135–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1133}
1134
1135staticfn struct bill_x *
1136onbill(struct obj *obj, struct monst *shkp, boolean silent)
1137{
1138 if (shkp) {
1139 struct bill_x *bp;
1140 int ct;
1141
1142 for (ct = ESHK(shkp)->billct, bp = ESHK(shkp)->bill_p;
1143 ct > 0; --ct, ++bp) {
1144 if (bp->bo_id == obj->o_id) {
1145 if (!obj->unpaid)
1146 impossible("onbill: paid obj on bill?");
1147 return bp;
1148 }
1149 }
1150 }
1151 if (obj->unpaid && !silent)
1152 impossible("onbill: unpaid obj %s?",
1153 !shkp ? "without shopkeeper" : "not on shk's bill");
1154 return (struct bill_x *) 0;
1155}
1156
1157/* used outside of shk.c when caller wants to know whether item is on bill
1158 but doesn't need to know any details about the bill itself */

Callers 13

clear_unpaid_objFunction · 0.85
same_priceFunction · 0.85
onshopbillFunction · 0.85
obfreeFunction · 0.85
alter_costFunction · 0.85
unpaid_costFunction · 0.85
billableFunction · 0.85
splitbillFunction · 0.85
sub_one_frombillFunction · 0.85
stolen_containerFunction · 0.85
stolen_valueFunction · 0.85
litter_scatterFunction · 0.85

Calls 1

impossibleFunction · 0.70

Tested by

no test coverage detected