Modified objects initialization to support re-entry.
This commit is contained in:
@@ -33,9 +33,7 @@ boolean resuming;
|
||||
/* Note: these initializers don't do anything except guarantee that
|
||||
we're linked properly.
|
||||
*/
|
||||
decl_init();
|
||||
monst_init();
|
||||
objects_init();
|
||||
|
||||
/* if a save file created in normal mode is now being restored in
|
||||
explore mode, treat it as normal restore followed by 'X' command
|
||||
|
||||
@@ -318,13 +318,6 @@ const char *ARGV0;
|
||||
/* support for lint.h */
|
||||
unsigned nhUse_dummy = 0;
|
||||
|
||||
/* dummy routine used to force linkage */
|
||||
void
|
||||
decl_init()
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#define IVMAGIC 0xdeadbeef
|
||||
|
||||
const struct instance_globals g_init = {
|
||||
@@ -420,7 +413,7 @@ const struct instance_globals g_init = {
|
||||
struct instance_globals g;
|
||||
|
||||
void
|
||||
instance_globals_init()
|
||||
decl_globals_init()
|
||||
{
|
||||
g = g_init;
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ struct monst { struct monst *dummy; }; /* lint: struct obj's union */
|
||||
cost,sdam,ldam,oc1,oc2,nut,color) { obj }
|
||||
#define None (char *) 0 /* less visual distraction for 'no description' */
|
||||
|
||||
NEARDATA struct objdescr obj_descr[] =
|
||||
NEARDATA struct objdescr obj_descr_init[] =
|
||||
#else
|
||||
/* second pass -- object definitions */
|
||||
#define BITS(nmkn,mrg,uskn,ctnr,mgc,chrg,uniq,nwsh,big,tuf,dir,sub,mtrl) \
|
||||
@@ -75,7 +75,7 @@ NEARDATA struct objdescr obj_descr[] =
|
||||
#define HARDGEM(n) (0)
|
||||
#endif
|
||||
|
||||
NEARDATA struct objclass objects[] =
|
||||
NEARDATA struct objclass obj_init[] =
|
||||
#endif
|
||||
{
|
||||
/* dummy object[0] -- description [2nd arg] *must* be NULL */
|
||||
@@ -1169,13 +1169,14 @@ OBJECT(OBJ(None, None),
|
||||
/* clang-format on */
|
||||
/* *INDENT-ON* */
|
||||
|
||||
void NDECL(objects_init);
|
||||
struct objdescr obj_descr[SIZE(obj_descr_init)];
|
||||
struct objclass objects[SIZE(obj_init)];
|
||||
|
||||
/* dummy routine used to force linkage */
|
||||
void
|
||||
objects_init()
|
||||
objects_globals_init()
|
||||
{
|
||||
return;
|
||||
memcpy(obj_descr, obj_descr_init, sizeof(obj_descr));
|
||||
memcpy(objects, obj_init, sizeof(objects));
|
||||
}
|
||||
|
||||
#endif /* !OBJECTS_PASS_2_ */
|
||||
|
||||
Reference in New Issue
Block a user