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

Function set_wall

src/display.c:3186–3204  ·  view source on GitHub ↗

Return wall mode for a horizontal or vertical wall. */

Source from the content-addressed store, hash-verified

3184
3185/* Return wall mode for a horizontal or vertical wall. */
3186staticfn int
3187set_wall(coordxy x, coordxy y, int horiz)
3188{
3189 int wmode, is_1, is_2;
3190
3191 if (horiz) {
3192 is_1 = check_pos(x, y - 1, WM_W_TOP);
3193 is_2 = check_pos(x, y + 1, WM_W_BOTTOM);
3194 } else {
3195 is_1 = check_pos(x - 1, y, WM_W_LEFT);
3196 is_2 = check_pos(x + 1, y, WM_W_RIGHT);
3197 }
3198 if (more_than_one(x, y, is_1, is_2, 0)) {
3199 wmode = 0;
3200 } else {
3201 wmode = is_1 + is_2;
3202 }
3203 return wmode;
3204}
3205
3206/* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */
3207staticfn int

Callers 1

xy_set_wall_stateFunction · 0.85

Calls 2

check_posFunction · 0.85
more_than_oneFunction · 0.85

Tested by

no test coverage detected