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

Function l_selection_not

src/nhlsel.c:259–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257/* local s = selection.negate(); */
258/* local s = sel:negate(); */
259staticfn int
260l_selection_not(lua_State *L)
261{
262 int argc = lua_gettop(L);
263 struct selectionvar *sel, *sel2;
264
265 if (argc == 0) {
266 (void) l_selection_new(L);
267 sel = l_selection_check(L, 1);
268 selection_clear(sel, 1);
269 } else {
270 (void) l_selection_check(L, 1);
271 (void) l_selection_clone(L);
272 sel2 = l_selection_check(L, 2);
273 selection_not(sel2);
274 lua_remove(L, 1);
275 }
276 return 1;
277}
278
279/* local sel = selection.area(4,5, 40,10) & selection.rect(7,8, 60,14); */
280staticfn int

Callers

nothing calls this directly

Calls 5

l_selection_newFunction · 0.85
l_selection_checkFunction · 0.85
selection_clearFunction · 0.85
l_selection_cloneFunction · 0.85
selection_notFunction · 0.85

Tested by

no test coverage detected