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

Function save_waterlevel

src/mkmaze.c:1722–1745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1720}
1721
1722void
1723save_waterlevel(NHFILE *nhfp)
1724{
1725 struct bubble *b;
1726
1727 if (!svb.bbubbles)
1728 return;
1729
1730 if (update_file(nhfp)) {
1731 int n = 0;
1732 for (b = svb.bbubbles; b; b = b->next)
1733 ++n;
1734 Sfo_int(nhfp, &n, "waterlevel-bubble_count");
1735 Sfo_int(nhfp, &svx.xmin, "waterlevel-xmin");
1736 Sfo_int(nhfp, &svy.ymin, "waterlevel-ymin");
1737 Sfo_int(nhfp, &svx.xmax, "waterlevel-xmax");
1738 Sfo_int(nhfp, &svy.ymax, "waterlevel-ymax");
1739 for (b = svb.bbubbles; b; b = b->next) {
1740 Sfo_bubble(nhfp, b, "waterlevel-bubble");
1741 }
1742 }
1743 if (release_data(nhfp))
1744 unsetup_waterlevel();
1745}
1746#endif /* !SFCTOOL */
1747
1748/* restoring air bubbles on Plane of Water or clouds on Plane of Air */

Callers 1

save_bubblesFunction · 0.85

Calls 2

update_fileFunction · 0.85
unsetup_waterlevelFunction · 0.85

Tested by

no test coverage detected