| 5558 | |
| 5559 | /* inside a lua table, get fields x1,y1,x2,y2 or region table */ |
| 5560 | staticfn void |
| 5561 | get_table_coords_or_region(lua_State *L, |
| 5562 | coordxy *dx1, coordxy *dy1, |
| 5563 | coordxy *dx2, coordxy *dy2) |
| 5564 | { |
| 5565 | *dx1 = get_table_int_opt(L, "x1", -1); |
| 5566 | *dy1 = get_table_int_opt(L, "y1", -1); |
| 5567 | *dx2 = get_table_int_opt(L, "x2", -1); |
| 5568 | *dy2 = get_table_int_opt(L, "y2", -1); |
| 5569 | |
| 5570 | if (*dx1 == -1 && *dy1 == -1 && *dx2 == -1 && *dy2 == -1) { |
| 5571 | lua_Integer rx1, ry1, rx2, ry2; |
| 5572 | |
| 5573 | get_table_region(L, "region", &rx1, &ry1, &rx2, &ry2, FALSE); |
| 5574 | *dx1 = rx1; *dy1 = ry1; |
| 5575 | *dx2 = rx2; *dy2 = ry2; |
| 5576 | } |
| 5577 | } |
| 5578 | |
| 5579 | /* region(selection, lit); */ |
| 5580 | /* region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, |
no test coverage detected