sobj_at(&c) traversal -- find next object of specified type */
| 1476 | |
| 1477 | /* sobj_at(&c) traversal -- find next object of specified type */ |
| 1478 | struct obj * |
| 1479 | nxtobj(struct obj *obj, int type, boolean by_nexthere) |
| 1480 | { |
| 1481 | struct obj *otmp; |
| 1482 | |
| 1483 | otmp = obj; /* start with the object after this one */ |
| 1484 | do { |
| 1485 | otmp = !by_nexthere ? otmp->nobj : otmp->nexthere; |
| 1486 | if (!otmp) |
| 1487 | break; |
| 1488 | } while (otmp->otyp != type); |
| 1489 | |
| 1490 | return otmp; |
| 1491 | } |
| 1492 | |
| 1493 | /* return inventory object of type 'type' if hero has one, otherwise Null */ |
| 1494 | struct obj * |
no outgoing calls
no test coverage detected