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

Function savenames

src/o_init.c:374–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

372}
373
374void
375savenames(NHFILE *nhfp)
376{
377 int i;
378 unsigned int len;
379
380 if (update_file(nhfp)) {
381 for (i = 0; i < (MAXOCLASSES + 2); ++i) {
382 Sfo_int(nhfp, &svb.bases[i], "names-bases");
383 }
384 for (i = 0; i < NUM_OBJECTS; ++i) {
385 Sfo_short(nhfp, &svd.disco[i], "names-disco");
386 }
387 for (i = 0; i < NUM_OBJECTS; ++i) {
388 Sfo_objclass(nhfp, &objects[i], "names-objclass");
389 }
390 }
391 /* as long as we use only one version of Hack we
392 need not save oc_name and oc_descr, but we must save
393 oc_uname for all objects */
394 for (i = 0; i < NUM_OBJECTS; i++)
395 if (objects[i].oc_uname) {
396 if (update_file(nhfp)) {
397 len = Strlen(objects[i].oc_uname) + 1;
398 Sfo_unsigned(nhfp, &len, "names-len");
399 Sfo_char(nhfp, objects[i].oc_uname, "names-oc_uname",
400 (int) len);
401 }
402 if (release_data(nhfp)) {
403 free((genericptr_t) objects[i].oc_uname);
404 objects[i].oc_uname = 0;
405 }
406 }
407}
408#endif /* !SFCTOOL */
409
410void

Callers 1

savegamestateFunction · 0.85

Calls 1

update_fileFunction · 0.85

Tested by

no test coverage detected