From 7ce4c28eb9c4d28987e4b5e4fe1fea5543f82574 Mon Sep 17 00:00:00 2001 From: nhmall Date: Fri, 23 Nov 2018 22:17:14 -0500 Subject: [PATCH] Revert "Fixed nocreate." This reverts commit 244a473a19866d7e74d82d7ae7457a1355aaa463. --- include/decl.h | 4 ---- src/decl.c | 4 ---- src/u_init.c | 21 +++++++++++++-------- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/include/decl.h b/include/decl.h index 49bd34d2e..4716f158c 100644 --- a/include/decl.h +++ b/include/decl.h @@ -452,10 +452,6 @@ struct instance_context { int spec_dbon_applies; /* coordinate effects from spec_dbon() with * messages in artifact_hit() - artifact.c */ int mrank_sz; /* loaded by max_rank_sz - botl.c */ - short nocreate; /* ini_inv() - u_init.c = STRANGE_OBJECT */ - short nocreate2; /* ini_inv() - u_init.c = STRANGE_OBJECT */ - short nocreate3; /* ini_inv() - u_init.c = STRANGE_OBJECT */ - short nocreate4; /* ini_inv() - u_init.c = STRANGE_OBJECT */ }; E struct instance_context icontext; diff --git a/src/decl.c b/src/decl.c index 2f52fc41f..2a259efaa 100644 --- a/src/decl.c +++ b/src/decl.c @@ -333,10 +333,6 @@ const struct instance_context icontext_initial_state = { -1, /* polearm_range_max - apply.c */ 0, /* spec_dbon_applies - artifact.c */ 0, /* mrank_sz - botl.c */ - STRANGE_OBJECT, /* nocreate - ini_inv() in u_init.c */ - STRANGE_OBJECT, /* nocreate2 - ini_inv() in u_init.c */ - STRANGE_OBJECT, /* nocreate3 - ini_inv() in u_init.c */ - STRANGE_OBJECT, /* nocreate4 - ini_inv() in u_init.c */ }; struct instance_context icontext; diff --git a/src/u_init.c b/src/u_init.c index 9d38214ed..71da5a84a 100644 --- a/src/u_init.c +++ b/src/u_init.c @@ -974,6 +974,11 @@ register struct trobj *trop; struct obj *obj; int otyp, i; + NEARDATA short nocreate = STRANGE_OBJECT; + NEARDATA short nocreate2 = STRANGE_OBJECT; + NEARDATA short nocreate3 = STRANGE_OBJECT; + NEARDATA short nocreate4 = STRANGE_OBJECT; + while (trop->trclass) { otyp = (int) trop->trotyp; if (otyp != UNDEF_TYP) { @@ -991,9 +996,9 @@ register struct trobj *trop; */ obj = mkobj(trop->trclass, FALSE); otyp = obj->otyp; - while (otyp == WAN_WISHING || otyp == icontext.nocreate - || otyp == icontext.nocreate2 || otyp == icontext.nocreate3 - || otyp == icontext.nocreate4 || otyp == RIN_LEVITATION + while (otyp == WAN_WISHING || otyp == nocreate + || otyp == nocreate2 || otyp == nocreate3 + || otyp == nocreate4 || otyp == RIN_LEVITATION /* 'useless' items */ || otyp == POT_HALLUCINATION || otyp == POT_ACID @@ -1035,16 +1040,16 @@ register struct trobj *trop; case WAN_POLYMORPH: case RIN_POLYMORPH: case POT_POLYMORPH: - icontext.nocreate = RIN_POLYMORPH_CONTROL; + nocreate = RIN_POLYMORPH_CONTROL; break; case RIN_POLYMORPH_CONTROL: - icontext.nocreate = RIN_POLYMORPH; - icontext.nocreate2 = SPE_POLYMORPH; - icontext.nocreate3 = POT_POLYMORPH; + nocreate = RIN_POLYMORPH; + nocreate2 = SPE_POLYMORPH; + nocreate3 = POT_POLYMORPH; } /* Don't have 2 of the same ring or spellbook */ if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS) - icontext.nocreate4 = otyp; + nocreate4 = otyp; } if (urace.malenum != PM_HUMAN) {