fix pull request #479 - statues of stoning-immunes
Statues on Medusa's level are supposed to be from petrified creatures rather than somebody's artwork, so creatures that can't be turned to stone aren't eligible. However, creatures who change form when hit with stoning damage (foo golems to stone golem) were being allowed. Also, statues in cockatrice nest rooms are supposed to be from former characters and take their names from the high scores file. But when 'record' is empty, the statue would be of a random creature instead of being changed into a player character, so both not the latter and possibly something that can't be petrified. I've taken the Medusa part as-is but did the cockatrice nest part differently. It rejected statues of non-stonable creatures in case the named character attempt failed. I've changed things so that when a named player character can't be created, it will use an unnamed one instead of random creature. The issue of maybe ending up with a non- stonable form goes away because all player characters are vulnerable. Fixes #479
This commit is contained in:
13
src/mkobj.c
13
src/mkobj.c
@@ -1627,10 +1627,15 @@ mk_tt_object(
|
||||
/* player statues never contain books */
|
||||
initialize_it = (objtype != STATUE);
|
||||
otmp = mksobj_at(objtype, x, y, initialize_it, FALSE);
|
||||
/* tt_oname() will return null if the scoreboard is empty;
|
||||
assigning an object name used to allocate a new obj but
|
||||
doesn't any more so we can safely ignore the return value */
|
||||
(void) tt_oname(otmp);
|
||||
|
||||
/* tt_oname() will return null if the scoreboard is empty, which in
|
||||
turn leaves the random corpsenm value; force it to match a player */
|
||||
if (!tt_oname(otmp)) {
|
||||
int pm = rn1(PM_WIZARD - PM_ARCHEOLOGIST + 1, PM_ARCHEOLOGIST);
|
||||
|
||||
/* update weight for either, force timer sanity for corpses */
|
||||
set_corpsenm(otmp, pm);
|
||||
}
|
||||
|
||||
return otmp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user