From f0f9701a375f2646b965c096c9841c3e05f51a0c Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 24 Nov 2021 00:46:44 -0800 Subject: [PATCH] attempting to polymorph into a unique monster Noticed while testing revised "the" handling and trying to trigger "you can't polymorph into [the] Oracle", if the character was human it would turn into a new man or woman instead of having the unique form be rejected. --- doc/fixes37.0 | 3 +++ src/polyself.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 3716cdccb..c08a0bd11 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -688,6 +688,9 @@ if hero is wearing an amulet of magical breathing and polymorphs into a fish or sea monster, don't lose health for turns spent out of water fix up some "the" handling for monsters whose type name is upper case to avoid "Uruk-hai is healthy for a statue", "You can't polymorph into Oracle" +controlled polymorph would turn hero into new man or woman if player asked to + become a unique monster of the same race (so usually human) instead of + being told that polymorphing into the specified form wasn't allowed Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/polyself.c b/src/polyself.c index 78f620f6c..a09e755f3 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -478,8 +478,11 @@ polyself(int psflags) } else if (!polyok(&mons[mntmp]) /* Note: humans are illegal as monsters, but an illegal monster forces newman(), which is what - we want if they specified a human.... */ - && !(mntmp == PM_HUMAN || your_race(&mons[mntmp]) + we want if they specified a human.... (unless + they specified a unique monster) */ + && !(mntmp == PM_HUMAN + || (your_race(&mons[mntmp]) + && (mons[mntmp].geno & G_UNIQ) == 0) || mntmp == g.urole.malenum || mntmp == g.urole.femalenum)) { const char *pm_name;