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

Function costly_tin

src/eat.c:1388–1402  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1386/* common code to check and possibly charge for 1 svc.context.tin.tin,
1387 * will split() svc.context.tin.tin if necessary */
1388staticfn struct obj *
1389costly_tin(int alter_type) /* COST_xxx */
1390{
1391 struct obj *tin = svc.context.tin.tin;
1392
1393 if (carried(tin) ? tin->unpaid
1394 : (costly_spot(tin->ox, tin->oy) && !tin->no_charge)) {
1395 if (tin->quan > 1L) {
1396 tin = svc.context.tin.tin = splitobj(tin, 1L);
1397 svc.context.tin.o_id = tin->o_id;
1398 }
1399 costly_alteration(tin, alter_type);
1400 }
1401 return tin;
1402}
1403
1404int
1405tin_variety_txt(char *s, int *tinvariety)

Callers 1

consume_tinFunction · 0.85

Calls 3

costly_spotFunction · 0.85
splitobjFunction · 0.85
costly_alterationFunction · 0.85

Tested by

no test coverage detected