Fixed nocreate.
This commit is contained in:
@@ -452,6 +452,10 @@ struct instance_context {
|
|||||||
int spec_dbon_applies; /* coordinate effects from spec_dbon() with
|
int spec_dbon_applies; /* coordinate effects from spec_dbon() with
|
||||||
* messages in artifact_hit() - artifact.c */
|
* messages in artifact_hit() - artifact.c */
|
||||||
int mrank_sz; /* loaded by max_rank_sz - botl.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;
|
E struct instance_context icontext;
|
||||||
|
|||||||
@@ -333,6 +333,10 @@ const struct instance_context icontext_initial_state = {
|
|||||||
-1, /* polearm_range_max - apply.c */
|
-1, /* polearm_range_max - apply.c */
|
||||||
0, /* spec_dbon_applies - artifact.c */
|
0, /* spec_dbon_applies - artifact.c */
|
||||||
0, /* mrank_sz - botl.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;
|
struct instance_context icontext;
|
||||||
|
|||||||
21
src/u_init.c
21
src/u_init.c
@@ -974,11 +974,6 @@ register struct trobj *trop;
|
|||||||
struct obj *obj;
|
struct obj *obj;
|
||||||
int otyp, i;
|
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) {
|
while (trop->trclass) {
|
||||||
otyp = (int) trop->trotyp;
|
otyp = (int) trop->trotyp;
|
||||||
if (otyp != UNDEF_TYP) {
|
if (otyp != UNDEF_TYP) {
|
||||||
@@ -996,9 +991,9 @@ register struct trobj *trop;
|
|||||||
*/
|
*/
|
||||||
obj = mkobj(trop->trclass, FALSE);
|
obj = mkobj(trop->trclass, FALSE);
|
||||||
otyp = obj->otyp;
|
otyp = obj->otyp;
|
||||||
while (otyp == WAN_WISHING || otyp == nocreate
|
while (otyp == WAN_WISHING || otyp == icontext.nocreate
|
||||||
|| otyp == nocreate2 || otyp == nocreate3
|
|| otyp == icontext.nocreate2 || otyp == icontext.nocreate3
|
||||||
|| otyp == nocreate4 || otyp == RIN_LEVITATION
|
|| otyp == icontext.nocreate4 || otyp == RIN_LEVITATION
|
||||||
/* 'useless' items */
|
/* 'useless' items */
|
||||||
|| otyp == POT_HALLUCINATION
|
|| otyp == POT_HALLUCINATION
|
||||||
|| otyp == POT_ACID
|
|| otyp == POT_ACID
|
||||||
@@ -1040,16 +1035,16 @@ register struct trobj *trop;
|
|||||||
case WAN_POLYMORPH:
|
case WAN_POLYMORPH:
|
||||||
case RIN_POLYMORPH:
|
case RIN_POLYMORPH:
|
||||||
case POT_POLYMORPH:
|
case POT_POLYMORPH:
|
||||||
nocreate = RIN_POLYMORPH_CONTROL;
|
icontext.nocreate = RIN_POLYMORPH_CONTROL;
|
||||||
break;
|
break;
|
||||||
case RIN_POLYMORPH_CONTROL:
|
case RIN_POLYMORPH_CONTROL:
|
||||||
nocreate = RIN_POLYMORPH;
|
icontext.nocreate = RIN_POLYMORPH;
|
||||||
nocreate2 = SPE_POLYMORPH;
|
icontext.nocreate2 = SPE_POLYMORPH;
|
||||||
nocreate3 = POT_POLYMORPH;
|
icontext.nocreate3 = POT_POLYMORPH;
|
||||||
}
|
}
|
||||||
/* Don't have 2 of the same ring or spellbook */
|
/* Don't have 2 of the same ring or spellbook */
|
||||||
if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
|
if (obj->oclass == RING_CLASS || obj->oclass == SPBOOK_CLASS)
|
||||||
nocreate4 = otyp;
|
icontext.nocreate4 = otyp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (urace.malenum != PM_HUMAN) {
|
if (urace.malenum != PM_HUMAN) {
|
||||||
|
|||||||
Reference in New Issue
Block a user