Unify unpolyable objects to single define
This commit is contained in:
@@ -356,6 +356,10 @@ struct obj {
|
|||||||
&& !undiscovered_artifact(ART_EYES_OF_THE_OVERWORLD)))
|
&& !undiscovered_artifact(ART_EYES_OF_THE_OVERWORLD)))
|
||||||
#define pair_of(o) ((o)->otyp == LENSES || is_gloves(o) || is_boots(o))
|
#define pair_of(o) ((o)->otyp == LENSES || is_gloves(o) || is_boots(o))
|
||||||
|
|
||||||
|
#define unpolyable(o) ((o)->otyp == WAN_POLYMORPH \
|
||||||
|
|| (o)->otyp == SPE_POLYMORPH \
|
||||||
|
|| (o)->otyp == POT_POLYMORPH)
|
||||||
|
|
||||||
/* achievement tracking; 3.6.x did this differently */
|
/* achievement tracking; 3.6.x did this differently */
|
||||||
#define is_mines_prize(o) ((o)->o_id == g.context.achieveo.mines_prize_oid)
|
#define is_mines_prize(o) ((o)->o_id == g.context.achieveo.mines_prize_oid)
|
||||||
#define is_soko_prize(o) ((o)->o_id == g.context.achieveo.soko_prize_oid)
|
#define is_soko_prize(o) ((o)->o_id == g.context.achieveo.soko_prize_oid)
|
||||||
|
|||||||
+1
-1
@@ -1978,7 +1978,7 @@ dodip()
|
|||||||
} else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
|
} else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
|
||||||
/* some objects can't be polymorphed */
|
/* some objects can't be polymorphed */
|
||||||
if (obj->otyp == potion->otyp /* both POT_POLY */
|
if (obj->otyp == potion->otyp /* both POT_POLY */
|
||||||
|| obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
|
|| unpolyable(obj)
|
||||||
|| obj == uball || obj == uskin
|
|| obj == uball || obj == uskin
|
||||||
|| obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
|
|| obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
|
||||||
5, 95)) {
|
5, 95)) {
|
||||||
|
|||||||
@@ -1964,8 +1964,7 @@ struct obj *obj, *otmp;
|
|||||||
switch (otmp->otyp) {
|
switch (otmp->otyp) {
|
||||||
case WAN_POLYMORPH:
|
case WAN_POLYMORPH:
|
||||||
case SPE_POLYMORPH:
|
case SPE_POLYMORPH:
|
||||||
if (obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
|
if (unpolyable(obj) || obj_resists(obj, 5, 95)) {
|
||||||
|| obj->otyp == POT_POLYMORPH || obj_resists(obj, 5, 95)) {
|
|
||||||
res = 0;
|
res = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user