TODO: FIXME from lev_comp SPO_LEVREGION was called as: - STAIR:(x1,y1,x2,y2),(x1,y1,x2,y2),dir - PORTAL:(x1,y1,x2,y2),(x1,y1,x2,y2),string - BRANCH:(x1,y1,x2,y2),(x1,y1,x2,y2),dir */ levregion({ region = { x1,y1, x2,y2 }, exclude = { x1,y1, x2,y2 }, * type = "portal", name="air" }); */ TODO: allow region to be optional, defaulting to whole level */
| 5469 | * type = "portal", name="air" }); */ |
| 5470 | /* TODO: allow region to be optional, defaulting to whole level */ |
| 5471 | int |
| 5472 | lspo_levregion(lua_State *L) |
| 5473 | { |
| 5474 | static const char *const regiontypes[] = { |
| 5475 | "stair-down", "stair-up", "portal", "branch", |
| 5476 | "teleport", "teleport-up", "teleport-down", NULL |
| 5477 | }; |
| 5478 | static const int regiontypes2i[] = { |
| 5479 | LR_DOWNSTAIR, LR_UPSTAIR, LR_PORTAL, LR_BRANCH, |
| 5480 | LR_TELE, LR_UPTELE, LR_DOWNTELE, 0 |
| 5481 | }; |
| 5482 | lev_region tmplregion; |
| 5483 | |
| 5484 | create_des_coder(); |
| 5485 | lcheck_param_table(L); |
| 5486 | l_get_lregion(L, &tmplregion); |
| 5487 | tmplregion.rtype = regiontypes2i[get_table_option(L, "type", "stair-down", |
| 5488 | regiontypes)]; |
| 5489 | tmplregion.padding = get_table_int_opt(L, "padding", 0); |
| 5490 | tmplregion.rname.str = get_table_str_opt(L, "name", NULL); |
| 5491 | |
| 5492 | levregion_add(&tmplregion); |
| 5493 | return 0; |
| 5494 | } |
| 5495 | |
| 5496 | /* exclusion({ type = "teleport", region = { x1,y1, x2,y2 } }); */ |
| 5497 | int |
nothing calls this directly
no test coverage detected