exclusion({ type = "teleport", region = { x1,y1, x2,y2 } }); */
| 5495 | |
| 5496 | /* exclusion({ type = "teleport", region = { x1,y1, x2,y2 } }); */ |
| 5497 | int |
| 5498 | lspo_exclusion(lua_State *L) |
| 5499 | { |
| 5500 | static const char *const ez_types[] = { |
| 5501 | "teleport", "teleport-up", "teleport-down", "monster-generation", NULL |
| 5502 | }; |
| 5503 | static const int ez_types2i[] = { |
| 5504 | LR_TELE, LR_UPTELE, LR_DOWNTELE, LR_MONGEN, 0 |
| 5505 | }; |
| 5506 | struct exclusion_zone *ez = (struct exclusion_zone *) alloc(sizeof *ez); |
| 5507 | lua_Integer x1,y1,x2,y2; |
| 5508 | coordxy a1,b1,a2,b2; |
| 5509 | |
| 5510 | create_des_coder(); |
| 5511 | lcheck_param_table(L); |
| 5512 | ez->zonetype = ez_types2i[get_table_option(L, "type", "teleport", |
| 5513 | ez_types)]; |
| 5514 | get_table_region(L, "region", &x1, &y1, &x2, &y2, FALSE); |
| 5515 | |
| 5516 | a1 = x1, b1 = y1; |
| 5517 | a2 = x2, b2 = y2; |
| 5518 | |
| 5519 | get_location_coord(&a1, &b1, ANY_LOC|NO_LOC_WARN, gc.coder->croom, |
| 5520 | SP_COORD_PACK(a1, b1)); |
| 5521 | get_location_coord(&a2, &b2, ANY_LOC|NO_LOC_WARN, gc.coder->croom, |
| 5522 | SP_COORD_PACK(a2, b2)); |
| 5523 | |
| 5524 | ez->lx = a1; |
| 5525 | ez->ly = b1; |
| 5526 | ez->hx = a2; |
| 5527 | ez->hy = b2; |
| 5528 | |
| 5529 | ez->next = sve.exclusion_zones; |
| 5530 | sve.exclusion_zones = ez; |
| 5531 | return 0; |
| 5532 | } |
| 5533 | |
| 5534 | staticfn void |
| 5535 | sel_set_lit(coordxy x, coordxy y, genericptr_t arg) |
nothing calls this directly
no test coverage detected