MCPcopy Create free account
hub / github.com/NetHack/NetHack / create_gas_cloud_selection

Function create_gas_cloud_selection

src/region.c:1312–1336  ·  view source on GitHub ↗

create a single gas cloud from selection */

Source from the content-addressed store, hash-verified

1310
1311/* create a single gas cloud from selection */
1312NhRegion *
1313create_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? */

Callers 1

lspo_gas_cloudFunction · 0.85

Calls 6

is_hero_inside_gas_cloudFunction · 0.85
selection_getboundsFunction · 0.85
create_regionFunction · 0.85
selection_getpointFunction · 0.85
add_rect_to_regFunction · 0.85
make_gas_cloudFunction · 0.85

Tested by

no test coverage detected