create a single gas cloud from selection */
| 1310 | |
| 1311 | /* create a single gas cloud from selection */ |
| 1312 | NhRegion * |
| 1313 | create_gas_cloud_selection( |
| 1314 | struct selectionvar *sel, |
| 1315 | int damage) |
| 1316 | { |
| 1317 | NhRegion *cloud; |
| 1318 | NhRect tmprect; |
| 1319 | coordxy x, y; |
| 1320 | NhRect r = cg.zeroNhRect; |
| 1321 | boolean inside_cloud = is_hero_inside_gas_cloud(); |
| 1322 | |
| 1323 | selection_getbounds(sel, &r); |
| 1324 | |
| 1325 | cloud = create_region((NhRect *) 0, 0); |
| 1326 | for (x = r.lx; x <= r.hx; x++) |
| 1327 | for (y = r.ly; y <= r.hy; y++) |
| 1328 | if (selection_getpoint(x, y, sel)) { |
| 1329 | tmprect.lx = tmprect.hx = x; |
| 1330 | tmprect.ly = tmprect.hy = y; |
| 1331 | add_rect_to_reg(cloud, &tmprect); |
| 1332 | } |
| 1333 | |
| 1334 | make_gas_cloud(cloud, damage, inside_cloud); |
| 1335 | return cloud; |
| 1336 | } |
| 1337 | |
| 1338 | |
| 1339 | /* for checking troubles during prayer; is hero at risk? */ |
no test coverage detected