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

Function rest_stairs

src/restore.c:954–985  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952#endif /* !SFCTOOL */
953
954staticfn void
955rest_stairs(NHFILE *nhfp)
956{
957 int buflen = 0;
958 stairway stway = UNDEFINED_VALUES;
959#ifndef SFCTOOL
960 stairway *newst;
961#endif
962
963#ifndef SFCTOOL
964 stairway_free_all();
965#endif
966 while (1) {
967 Sfi_int(nhfp, &buflen, "stairs-staircount");
968 if (buflen == -1)
969 break;
970
971 Sfi_stairway(nhfp, &stway, "stairs-stairway");
972 if (program_state.restoring != REST_GSTATE
973 && stway.tolev.dnum == u.uz.dnum) {
974 /* stairway dlevel is relative, make it absolute */
975 stway.tolev.dlevel += u.uz.dlevel;
976 }
977#ifndef SFCTOOL
978 stairway_add(stway.sx, stway.sy, stway.up, stway.isladder,
979 &(stway.tolev));
980 newst = stairway_at(stway.sx, stway.sy);
981 if (newst)
982 newst->u_traversed = stway.u_traversed;
983#endif
984 }
985}
986
987void
988restcemetery(NHFILE *nhfp, struct cemetery **cemeteryaddr)

Callers 1

getlevFunction · 0.85

Calls 3

stairway_free_allFunction · 0.85
stairway_addFunction · 0.85
stairway_atFunction · 0.85

Tested by

no test coverage detected