local s = selection.floodfill(x,y); */ local s = selection.floodfill(x,y, diagonals); */
| 723 | /* local s = selection.floodfill(x,y); */ |
| 724 | /* local s = selection.floodfill(x,y, diagonals); */ |
| 725 | staticfn int |
| 726 | l_selection_flood(lua_State *L) |
| 727 | { |
| 728 | int argc = lua_gettop(L); |
| 729 | struct selectionvar *sel = (struct selectionvar *) 0; |
| 730 | coordxy x = 0, y = 0; |
| 731 | boolean diagonals = FALSE; |
| 732 | |
| 733 | if (argc == 2 || argc == 3) { |
| 734 | x = (coordxy) luaL_checkinteger(L, 1); |
| 735 | y = (coordxy) luaL_checkinteger(L, 2); |
| 736 | if (argc == 3) |
| 737 | diagonals = lua_toboolean(L, 3); |
| 738 | lua_pop(L, argc); |
| 739 | (void) l_selection_new(L); |
| 740 | sel = l_selection_check(L, 1); |
| 741 | } else { |
| 742 | nhl_error(L, "wrong parameters"); |
| 743 | /*NOTREACHED*/ |
| 744 | } |
| 745 | |
| 746 | get_location_coord(&x, &y, ANY_LOC, gc.coder ? gc.coder->croom : NULL, |
| 747 | SP_COORD_PACK(x, y)); |
| 748 | |
| 749 | if (isok(x, y)) { |
| 750 | set_floodfillchk_match_under(levl[x][y].typ); |
| 751 | selection_floodfill(sel, x, y, diagonals); |
| 752 | } |
| 753 | return 1; |
| 754 | } |
| 755 | |
| 756 | |
| 757 | /* local s = selection.circle(x,y, radius); */ |
nothing calls this directly
no test coverage detected