/* Save all light sources of the given range. */ void save_light_sources(struct memfile *mf, struct level *lev, int range) { int count, actual; count = maybe_write_ls(mf, lev, range, FALSE); mwrite32(mf, count); actual = maybe_write_ls(mf, lev, range, TRUE); if (actual != count) panic("counted %d light sources, wrote %d! [range=%d]", count, actual, range); }
/* Save all light sources of the given range. */ void save_light_sources(struct memfile *mf, struct level *lev, int range) { int count, actual; mtag(mf, 2 * (int)ledger_no(&lev->z) + range, MTAG_LIGHTS); count = maybe_write_ls(mf, lev, range, FALSE); mwrite32(mf, count); actual = maybe_write_ls(mf, lev, range, TRUE); if (actual != count) panic("counted %d light sources, wrote %d! [range=%d]", count, actual, range); }