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

Function l_obj_nextobj

src/nhlobj.c:444–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442 local firstobj = obj.next();
443*/
444staticfn int
445l_obj_nextobj(lua_State *L)
446{
447 int argc = lua_gettop(L);
448
449 if (argc == 0) {
450 (void) l_obj_push(L, fobj);
451 } else {
452 struct _lua_obj *lo = l_obj_check(L, 1);
453 boolean use_nexthere = FALSE;
454
455 if (argc == 2)
456 use_nexthere = lua_toboolean(L, 2);
457
458 if (lo && lo->obj)
459 (void) l_obj_push(L, (use_nexthere && lo->obj->where == OBJ_FLOOR)
460 ? lo->obj->nexthere
461 : lo->obj->nobj);
462 }
463 return 1;
464}
465
466/* Get the container object is in */
467/* local box = o:container(); */

Callers

nothing calls this directly

Calls 2

l_obj_pushFunction · 0.85
l_obj_checkFunction · 0.85

Tested by

no test coverage detected