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

Function savedamage

src/save.c:639–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

637}
638
639staticfn void
640savedamage(NHFILE *nhfp)
641{
642 struct damage *damageptr, *tmp_dam;
643 unsigned int xl = 0;
644
645 damageptr = svl.level.damagelist;
646 for (tmp_dam = damageptr; tmp_dam; tmp_dam = tmp_dam->next)
647 xl++;
648 if (update_file(nhfp)) {
649 Sfo_unsigned(nhfp, &xl, "damage-damage_count");
650 }
651 while (damageptr) {
652 if (update_file(nhfp)) {
653 Sfo_damage(nhfp, damageptr, "damage");
654 }
655 tmp_dam = damageptr;
656 damageptr = damageptr->next;
657 if (release_data(nhfp))
658 free((genericptr_t) tmp_dam);
659 }
660 if (release_data(nhfp))
661 svl.level.damagelist = 0;
662}
663
664staticfn void
665save_stairs(NHFILE *nhfp)

Callers 1

savelev_coreFunction · 0.85

Calls 1

update_fileFunction · 0.85

Tested by

no test coverage detected