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

Function l_selection_room

src/nhlsel.c:431–450  ·  view source on GitHub ↗

local s = selection.room(); */

Source from the content-addressed store, hash-verified

429
430/* local s = selection.room(); */
431staticfn int
432l_selection_room(lua_State *L)
433{
434 struct selectionvar *sel;
435 int argc = lua_gettop(L);
436 struct mkroom *croom = NULL;
437
438 if (argc == 1) {
439 int i = luaL_checkinteger(L, -1);
440
441 croom = (i >= 0 && i < svn.nroom) ? &svr.rooms[i] : NULL;
442 }
443
444 sel = selection_from_mkroom(croom);
445
446 l_selection_push_copy(L, sel);
447 selection_free(sel, TRUE);
448
449 return 1;
450}
451
452/* local rect = sel:bounds(); */
453staticfn int

Callers

nothing calls this directly

Calls 3

selection_from_mkroomFunction · 0.85
l_selection_push_copyFunction · 0.85
selection_freeFunction · 0.85

Tested by

no test coverage detected