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

Function o_material

src/detect.c:228–246  ·  view source on GitHub ↗

Recursively search obj for an object made of specified material. * Return first found. */

Source from the content-addressed store, hash-verified

226 * Return first found.
227 */
228struct obj *
229o_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
248staticfn void
249observe_recursively(struct obj *obj)

Callers 2

check_map_spotFunction · 0.85
gold_detectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected