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

Function sel_set_ter

src/sp_lev.c:4608–4630  ·  view source on GitHub ↗

change map location terrain type during level creation */

Source from the content-addressed store, hash-verified

4606
4607/* change map location terrain type during level creation */
4608staticfn void
4609sel_set_ter(coordxy x, coordxy y, genericptr_t arg)
4610{
4611 terrain terr;
4612
4613 terr = *(terrain *) arg;
4614 if (!set_levltyp_lit(x, y, terr.ter, terr.tlit))
4615 return;
4616 /* TODO: move this below into set_levltyp? */
4617 /* handle doors and secret doors */
4618 if (levl[x][y].typ == SDOOR || IS_DOOR(levl[x][y].typ)) {
4619 if (levl[x][y].typ == SDOOR)
4620 levl[x][y].doormask = D_CLOSED;
4621 if (x && (IS_WALL(levl[x - 1][y].typ) || levl[x - 1][y].horizontal))
4622 levl[x][y].horizontal = 1;
4623 } else if (levl[x][y].typ == HWALL || levl[x][y].typ == IRONBARS) {
4624 levl[x][y].horizontal = 1;
4625 } else if (splev_init_present && levl[x][y].typ == ICE) {
4626 levl[x][y].icedpool = icedpools ? ICED_POOL : ICED_MOAT;
4627 } else if (levl[x][y].typ == CLOUD) {
4628 del_engr_at(x, y); /* clouds cannot have engravings */
4629 }
4630}
4631
4632staticfn void
4633sel_set_feature(coordxy x, coordxy y, genericptr_t arg)

Callers 2

lspo_terrainFunction · 0.85
lspo_mapFunction · 0.85

Calls 2

set_levltyp_litFunction · 0.85
del_engr_atFunction · 0.85

Tested by

no test coverage detected