Unify unpolyable objects to single define

This commit is contained in:
Pasi Kallinen
2020-11-16 18:42:12 +02:00
parent 7395d1eda1
commit d81e1672aa
3 changed files with 6 additions and 3 deletions

View File

@@ -1978,7 +1978,7 @@ dodip()
} else if (obj->otyp == POT_POLYMORPH || potion->otyp == POT_POLYMORPH) {
/* some objects can't be polymorphed */
if (obj->otyp == potion->otyp /* both POT_POLY */
|| obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
|| unpolyable(obj)
|| obj == uball || obj == uskin
|| obj_resists(obj->otyp == POT_POLYMORPH ? potion : obj,
5, 95)) {

View File

@@ -1964,8 +1964,7 @@ struct obj *obj, *otmp;
switch (otmp->otyp) {
case WAN_POLYMORPH:
case SPE_POLYMORPH:
if (obj->otyp == WAN_POLYMORPH || obj->otyp == SPE_POLYMORPH
|| obj->otyp == POT_POLYMORPH || obj_resists(obj, 5, 95)) {
if (unpolyable(obj) || obj_resists(obj, 5, 95)) {
res = 0;
break;
}