Fixed nocreate.

This commit is contained in:
Bart House
2018-11-22 21:55:03 -08:00
parent f0f0dea993
commit f8ab311e3d
3 changed files with 16 additions and 13 deletions

View File

@@ -452,6 +452,10 @@ 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;

View File

@@ -333,6 +333,10 @@ 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;

View File

@@ -974,11 +974,6 @@ 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) {
@@ -996,9 +991,9 @@ register struct trobj *trop;
*/
obj = mkobj(trop->trclass, FALSE);
otyp = obj->otyp;
while (otyp == WAN_WISHING || otyp == nocreate
|| otyp == nocreate2 || otyp == nocreate3
|| otyp == nocreate4 || otyp == RIN_LEVITATION
while (otyp == WAN_WISHING || otyp == icontext.nocreate
|| otyp == icontext.nocreate2 || otyp == icontext.nocreate3
|| otyp == icontext.nocreate4 || otyp == RIN_LEVITATION
/* 'useless' items */
|| otyp == POT_HALLUCINATION
|| otyp == POT_ACID
@@ -1040,16 +1035,16 @@ register struct trobj *trop;
case WAN_POLYMORPH:
case RIN_POLYMORPH:
case POT_POLYMORPH:
nocreate = RIN_POLYMORPH_CONTROL;
icontext.nocreate = RIN_POLYMORPH_CONTROL;
break;
case RIN_POLYMORPH_CONTROL:
nocreate = RIN_POLYMORPH;
nocreate2 = SPE_POLYMORPH;
nocreate3 = POT_POLYMORPH;
icontext.nocreate = RIN_POLYMORPH;
icontext.nocreate2 = SPE_POLYMORPH;
icontext.nocreate3 = POT_POLYMORPH;
}
/* Don't have 2 of the same ring or spellbook */
if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
nocreate4 = otyp;
icontext.nocreate4 = otyp;
}
if (urace.malenum != PM_HUMAN) {