Add some stair helper functions

This commit is contained in:
Pasi Kallinen
2020-02-08 17:02:18 +02:00
parent 9e4319824d
commit c585c65042
4 changed files with 36 additions and 25 deletions

View File

@@ -1645,8 +1645,7 @@ char *msg;
} else if (IS_SINK(ltyp)) {
Strcpy(msg, "A tangled mass of plumbing remains below the sink.");
return FALSE;
} else if ((cc->x == xupladder && cc->y == yupladder) /* ladder up */
|| (cc->x == xdnladder && cc->y == ydnladder)) { /* " down */
} else if (On_ladder(cc->x, cc->y)) {
Strcpy(msg, "The ladder is unaffected.");
return FALSE;
} else {
@@ -1658,15 +1657,8 @@ char *msg;
supporting = "throne";
else if (IS_ALTAR(ltyp))
supporting = "altar";
else if ((cc->x == xupstair && cc->y == yupstair)
|| (cc->x == g.sstairs.sx && cc->y == g.sstairs.sy
&& g.sstairs.up))
/* "staircase up" */
supporting = "stairs";
else if ((cc->x == xdnstair && cc->y == ydnstair)
|| (cc->x == g.sstairs.sx && cc->y == g.sstairs.sy
&& !g.sstairs.up))
/* "staircase down" */
else if (On_stairs(cc->x, cc->y))
/* staircase up or down. On_ladder handled above. */
supporting = "stairs";
else if (ltyp == DRAWBRIDGE_DOWN /* "lowered drawbridge" */
|| ltyp == DBWALL) /* "raised drawbridge" */