File src/restore.c


Included Files


Preprocessor definitions

#define N_PER_BUCKET 64

#define Is_IceBox( o )


Type struct bucket

struct bucket
struct bucket 
   { 
     struct bucket* next; 
     struct 
        { 
          unsigned gid; 
          unsigned nid; 
        } 
     map[64]; 
   } 

Global Variable restoring

boolean restoring
Visible in:  src/allmain.c
   src/apply.c
   src/artifact.c
   src/attrib.c
   src/ball.c
   src/bones.c
   src/botl.c
   src/cmd.c
   src/dbridge.c
   src/decl.c
   src/detect.c
   src/dig.c
   src/display.c
   src/do.c
   src/do_name.c
   src/do_wear.c
   src/dog.c
   src/dogmove.c
   src/dokick.c
   src/dothrow.c
   src/drawing.c
   src/dungeon.c
   src/eat.c
   src/end.c
   src/engrave.c
   src/exper.c
   src/explode.c
   src/extralev.c
   src/files.c
   src/fountain.c
   src/hack.c
   src/hacklib.c
   src/invent.c
   src/light.c
   src/lock.c
   src/mail.c
   src/makemon.c
   src/mcastu.c
   src/mhitm.c
   src/mhitu.c
   src/minion.c
   src/mklev.c
   src/mkmap.c
   src/mkmaze.c
   src/mkobj.c
   src/mkroom.c
   src/mon.c
   src/mondata.c
   src/monmove.c
   src/mplayer.c
   src/mthrowu.c
   src/muse.c
   src/music.c
   src/o_init.c
   src/objnam.c
   src/options.c
   src/pager.c
   src/pickup.c
   src/pline.c
   src/polyself.c
   src/potion.c
   src/pray.c
   src/priest.c
   src/quest.c
   src/questpgr.c
   src/read.c
   src/rect.c
   src/region.c
   src/restore.c
Used in: dorecover()src/restore.c
  mread()src/restore.c
  set_artifact_intrinsic()src/artifact.c

Local Variables

n_ids_mapped
static int n_ids_mapped
Used in: add_id_mapping()
  clear_id_mapping()
  lookup_id_mapping()

id_map
static struct bucket* id_map
Used in: add_id_mapping()
  clear_id_mapping()
  lookup_id_mapping()

oldfruit
static struct fruit* oldfruit
Used in: getlev()
  ghostfruit()

omoves
static long omoves
Used in: getlev()
  restdamage()
  restobjchn()


Global Function dorecover()

int dorecover ( int fd )
Prototyped in: include/extern.h
Calls: assign_rogue_graphics()src/drawing.c
  delete_savefile()src/files.c
  docrt()src/display.c
  getlev()src/restore.c
  inven_inuse()src/restore.c
  ledger_no()src/dungeon.c
  load_qtlist()src/questpgr.c
  max_rank_sz()src/botl.c
  on_level()src/dungeon.c
  reset_attribute_clock()src/attrib.c
  restgamestate()src/restore.c
  restlevelfile()src/restore.c
  restlevelstate()src/restore.c
  welcome()src/allmain.c
  close(), lseek(), read(), run_timers(), savelev(), savestateinlock(), setworn(), uptodate(), vision_reset()
References Variables: WIN_MESSAGEsrc/decl.c
  dungeon_topologysrc/decl.c
  flagssrc/decl.c
  levelsrc/decl.c
  program_statesrc/decl.c
  restoringsrc/restore.c
  usrc/decl.c
  vision_full_recalcsrc/decl.c
  windowprocs

Global Function getlev()

void getlev ( int fd, int pid, xchar lev, boolean ghostly )
Prototyped in: include/extern.h
Calls: Is_branchlev()src/dungeon.c
  alloc()src/alloc.c
  assign_level()src/dungeon.c
  clear_id_mapping()src/restore.c
  find_lev_obj()src/restore.c
  freefruitchn()src/restore.c
  ledger_no()src/dungeon.c
  loadfruitchn()src/restore.c
  mazexy()src/mkmaze.c
  mon_catchup_elapsed_time()src/dog.c
  mread()src/restore.c
  on_level()src/dungeon.c
  panic()src/end.c
  peace_minded()src/makemon.c
  pline()src/pline.c
  relink_light_sources()src/light.c
  reset_oattached_mids()src/restore.c
  rest_engravings()src/engrave.c
  rest_regions()src/region.c
  rest_rooms()src/mkroom.c
  restdamage()src/restore.c
  restmonchn()src/restore.c
  restobjchn()src/restore.c
  restore_cham()src/mon.c
  restore_light_sources()src/light.c
  set_malign()src/makemon.c
  trickery()src/restore.c
  deltrap(), free(), place_monster(), place_wsegs(), relink_timers(), rest_worm(), restore_timers(), set_residency()
Called by: dorecover()src/restore.c
  getbones()src/bones.c
  goto_level()src/do.c
References Variables: billobjssrc/decl.c
  dndestsrc/decl.c
  dnladdersrc/decl.c
  dnstairsrc/decl.c
  doorssrc/decl.c
  dungeon_topologysrc/decl.c
  flagssrc/decl.c
  ftrapsrc/decl.c
  levelsrc/decl.c
  monstermovessrc/decl.c
  oldfruitsrc/restore.c
  omovessrc/restore.c
  sstairssrc/decl.c
  usrc/decl.c
  updestsrc/decl.c
  upladdersrc/decl.c
  upstairsrc/decl.c

Global Function inven_inuse()

void inven_inuse ( boolean quietly )
Prototyped in: include/extern.h
Calls: pline()src/pline.c
  useup()src/invent.c
  xname()src/objnam.c
Called by: done()src/end.c
  dorecover()src/restore.c
References Variables: inventsrc/decl.c

Global Function lookup_id_mapping()

boolean lookup_id_mapping ( unsigned gid, unsigned* nidp )
Prototyped in: include/extern.h
Called by: relink_light_sources()src/light.c
  reset_oattached_mids()src/restore.c
References Variables: id_mapsrc/restore.c
  n_ids_mappedsrc/restore.c

Global Function minit()

void minit ( void )
Prototyped in: include/extern.h
Called by: goto_level()src/do.c

Global Function mread()

void mread ( int fd, genericptr_t buf, unsigned int len )
Prototyped in: include/extern.h
Calls: delete_savefile()src/files.c
  panic()src/end.c
  pline()src/pline.c
  close(), error(), read()
Called by: getbones()src/bones.c
  getlev()src/restore.c
  loadfruitchn()src/restore.c
  rest_engravings()src/engrave.c
  rest_regions()src/region.c
  rest_room()src/mkroom.c
  rest_rooms()src/mkroom.c
  restdamage()src/restore.c
  restgamestate()src/restore.c
  restlevchn()src/restore.c
  restmonchn()src/restore.c
  restnames()src/o_init.c
  restobjchn()src/restore.c
  restore_artifacts()src/artifact.c
  restore_dungeon()src/dungeon.c
  restore_light_sources()src/light.c
  restore_waterlevel()src/mkmaze.c
References Variables: restoringsrc/restore.c

Global Function trickery()

void trickery ( void )
Prototyped in: include/extern.h
Calls: done()src/end.c
  pline()src/pline.c
Called by: getbones()src/bones.c
  getlev()src/restore.c

Local Function add_id_mapping()

static void add_id_mapping ( unsigned gid, unsigned nid )
Prototyped in: src/restore.c
Calls: alloc()src/alloc.c
Called by: restmonchn()src/restore.c
  restobjchn()src/restore.c
References Variables: id_mapsrc/restore.c
  n_ids_mappedsrc/restore.c

Local Function clear_id_mapping()

static void clear_id_mapping ( void )
Prototyped in: src/restore.c
Calls: free()
Called by: getlev()src/restore.c
References Variables: id_mapsrc/restore.c
  n_ids_mappedsrc/restore.c

Local Function find_lev_obj()

static void find_lev_obj ( void )
Prototyped in: src/restore.c
Calls: place_object()src/mkobj.c
Called by: getlev()src/restore.c
References Variables: levelsrc/decl.c

Local Function freefruitchn()

static void freefruitchn ( struct fruit* flist )
Prototyped in: src/restore.c
Calls: free()
Called by: getlev()src/restore.c
  restgamestate()src/restore.c

Local Function ghostfruit()

static void ghostfruit ( struct obj* otmp )
Prototyped in: src/restore.c
Calls: fruitadd()src/options.c
  impossible()src/pline.c
Called by: restobjchn()src/restore.c
References Variables: oldfruitsrc/restore.c

Local Function loadfruitchn()

static struct fruit* loadfruitchn ( int fd )
Prototyped in: src/restore.c
Calls: alloc()src/alloc.c
  mread()src/restore.c
  free()
Called by: getlev()src/restore.c
  restgamestate()src/restore.c

Local Function reset_oattached_mids()

static void reset_oattached_mids ( boolean ghostly )
Prototyped in: src/restore.c
Calls: lookup_id_mapping()src/restore.c
  memcpy()
Called by: getlev()src/restore.c
References Variables: levelsrc/decl.c

Local Function restdamage()

static void restdamage ( int fd, boolean ghostly )
Prototyped in: src/restore.c
Calls: alloc()src/alloc.c
  in_rooms()src/hack.c
  mread()src/restore.c
  free(), inhishop(), repair_damage(), shop_keeper(), strcpy()
Called by: getlev()src/restore.c
References Variables: levelsrc/decl.c
  monstermovessrc/decl.c
  omovessrc/restore.c
  usrc/decl.c

Local Function restgamestate()

static boolean restgamestate ( int fd, unsigned int* mid, unsigned int* steedid )
Prototyped in: src/restore.c
Calls: You()src/pline.c
  freefruitchn()src/restore.c
  loadfruitchn()src/restore.c
  mread()src/restore.c
  pline()src/pline.c
  relink_light_sources()src/light.c
  restlevchn()src/restore.c
  restmonchn()src/restore.c
  restnames()src/o_init.c
  restobjchn()src/restore.c
  restore_artifacts()src/artifact.c
  restore_dungeon()src/dungeon.c
  restore_light_sources()src/light.c
  restore_waterlevel()src/mkmaze.c
  set_uasmon()src/polyself.c
  getuid(), relink_timers(), restore_oracles(), restore_timers(), role_init(), setuwep(), setworn()
Called by: dorecover()src/restore.c
References Variables: current_fruitsrc/decl.c
  dungeon_topologysrc/decl.c
  ffruitsrc/decl.c
  flagssrc/decl.c
  inventsrc/decl.c
  migrating_monssrc/decl.c
  migrating_objssrc/decl.c
  monstermovessrc/decl.c
  movessrc/decl.c
  mvitalssrc/decl.c
  pl_charactersrc/decl.c
  pl_fruitsrc/decl.c
  quest_statussrc/decl.c
  spl_booksrc/decl.c
  usrc/decl.c
  unweaponsrc/decl.c
  uwepsrc/decl.c
  windowprocs

Local Function restlevchn()

static void restlevchn ( int fd )
Prototyped in: src/restore.c
Calls: alloc()src/alloc.c
  mread()src/restore.c
Called by: restgamestate()src/restore.c
References Variables: sp_levchnsrc/decl.c

Local Function restlevelfile()

static int restlevelfile ( int fd, xchar ltmp )
Prototyped in: src/restore.c
Calls: create_levelfile()src/files.c
  panic()src/end.c
  bclose(), bufon(), savelev()
Called by: dorecover()src/restore.c

Local Function restlevelstate()

static void restlevelstate ( unsigned int mid, unsigned int steedid )
Prototyped in: src/restore.c
Calls: panic()src/end.c
Called by: dorecover()src/restore.c
References Variables: levelsrc/decl.c
  usrc/decl.c

Local Function restmonchn()

static struct monst* restmonchn ( int fd, boolean ghostly )
Prototyped in: src/restore.c
Calls: add_id_mapping()src/restore.c
  alloc()src/alloc.c
  impossible()src/pline.c
  mread()src/restore.c
  restobjchn()src/restore.c
  restpriest()src/priest.c
  restshk()
Called by: getlev()src/restore.c
  restgamestate()src/restore.c
References Variables: flagssrc/decl.c
  monssrc/monst.c

Local Function restobjchn()

static struct obj* restobjchn ( int fd, boolean ghostly, boolean frozen )
Prototyped in: src/restore.c
Calls: add_id_mapping()src/restore.c
  alloc()src/alloc.c
  ghostfruit()src/restore.c
  impossible()src/pline.c
  mread()src/restore.c
  restobjchn()src/restore.c
Called by: getlev()src/restore.c
  restgamestate()src/restore.c
  restmonchn()src/restore.c
  restobjchn()src/restore.c
References Variables: flagssrc/decl.c
  monstermovessrc/decl.c
  omovessrc/restore.c