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

Function restnames

src/o_init.c:410–437  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408#endif /* !SFCTOOL */
409
410void
411restnames(NHFILE *nhfp)
412{
413 int i;
414 unsigned int len = 0;
415
416 for (i = 0; i < (MAXOCLASSES + 2); ++i) {
417 Sfi_int(nhfp, &svb.bases[i], "names-bases");
418 }
419 for (i = 0; i < NUM_OBJECTS; ++i) {
420 Sfi_short(nhfp, &svd.disco[i], "names-disco");
421 }
422 for (i = 0; i < NUM_OBJECTS; ++i) {
423 Sfi_objclass(nhfp, &objects[i], "names-objclass");
424 }
425 for (i = 0; i < NUM_OBJECTS; i++) {
426 if (objects[i].oc_uname) {
427 Sfi_unsigned(nhfp, &len, "names-len");
428 objects[i].oc_uname = (char *) alloc(len);
429 Sfi_char(nhfp, objects[i].oc_uname, "names-oc_uname", (int) len);
430 }
431 }
432#ifndef SFCTOOL
433#ifdef TILES_IN_GLYPHMAP
434 shuffle_tiles();
435#endif
436#endif
437}
438
439#ifndef SFCTOOL
440/* make the object dknown and mark it as encountered */

Callers 1

restgamestateFunction · 0.85

Calls 2

shuffle_tilesFunction · 0.85
allocFunction · 0.70

Tested by

no test coverage detected