Recursively search obj for an object made of specified material. * Return first found. */
| 226 | * Return first found. |
| 227 | */ |
| 228 | struct obj * |
| 229 | o_material(struct obj *obj, unsigned material) |
| 230 | { |
| 231 | struct obj *otmp; |
| 232 | struct obj *temp; |
| 233 | |
| 234 | if (objects[obj->otyp].oc_material == material) |
| 235 | return obj; |
| 236 | |
| 237 | if (Has_contents(obj)) { |
| 238 | for (otmp = obj->cobj; otmp; otmp = otmp->nobj) |
| 239 | if (objects[otmp->otyp].oc_material == material) |
| 240 | return otmp; |
| 241 | else if (Has_contents(otmp) |
| 242 | && (temp = o_material(otmp, material)) != 0) |
| 243 | return temp; |
| 244 | } |
| 245 | return (struct obj *) 0; |
| 246 | } |
| 247 | |
| 248 | staticfn void |
| 249 | observe_recursively(struct obj *obj) |
no outgoing calls
no test coverage detected