diff --git a/doc/lua.adoc b/doc/lua.adoc index 67ed82c7e..5f447fe78 100644 --- a/doc/lua.adoc +++ b/doc/lua.adoc @@ -838,6 +838,11 @@ Example: Create a room region, which can be irregular; use the boundary <<_map_characters,map character>> to restrict the floodfilled area. +If using the first form with a selection and "lit", the lit area will extend +outward 1 space from the selection to attempt to accomodate adjacent walls, +regardless of whether they are actually walls or not. If using "unlit", this +will not happen. + Example: des.region(selection, lit); diff --git a/src/sp_lev.c b/src/sp_lev.c index eecbf43d6..e88fc0a9b 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -6061,12 +6061,12 @@ lspo_region(lua_State *L) } else if (argc == 2) { /* region(selection, "lit"); */ static const char *const lits[] = { "unlit", "lit", NULL }; - struct selectionvar *sel = l_selection_check(L, 1); + struct selectionvar *orig = l_selection_check(L, 1), + *sel = selection_clone(orig); rlit = luaL_checkoption(L, 2, "lit", lits); /* - TODO: adjust region size for wall, but only if lit TODO: lit=random */ if (rlit)