armor & busy hands
Fix some inconsistencies in armor handling. The 'T' command
wouldn't let you take off a suit or shirt if you were wielding a
cursed two-handed weapon, which makes sense; however, the 'A'
command neglected to impose the same restriction. Also, the 'W'
command had some code intended to prevent you from donning a suit
or shirt while wielding such a cursed weapon, but it didn't work.
This patch fixes the 'A' command's checks for whether an
item can be removed and it makes the 'T' and 'R' commands use the
same code as 'A' instead of maintaining multiple sets of checks.
It also fixes the trivial 'W' problem and attempts to prevent the
sequence of 1) get interrupted while removing a set of equipment
including suit and/or shirt; 2) wield a cursed two-handed weapon
or have already wielded one become cursed; 3) resume removing
armor via 'A' but I haven't tried to trigger that situation to
confirm the bug or this fix.
This commit is contained in:
13
src/mkobj.c
13
src/mkobj.c
@@ -1,4 +1,4 @@
|
||||
/* SCCS Id: @(#)mkobj.c 3.4 2001/12/03 */
|
||||
/* SCCS Id: @(#)mkobj.c 3.4 2002/08/02 */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -709,18 +709,21 @@ register struct obj *otmp;
|
||||
{
|
||||
otmp->blessed = 0;
|
||||
otmp->cursed = 1;
|
||||
if (otmp->otyp == LUCKSTONE
|
||||
|| (otmp->oartifact && spec_ability(otmp, SPFX_LUCK)))
|
||||
/* welded two-handed weapon interferes with some armor removal */
|
||||
if (otmp == uwep && bimanual(uwep)) reset_remarm();
|
||||
/* some cursed items need immediate updating */
|
||||
if (carried(otmp) && (otmp->otyp == LUCKSTONE ||
|
||||
(otmp->oartifact && spec_ability(otmp, SPFX_LUCK))))
|
||||
set_moreluck();
|
||||
else if (otmp->otyp == BAG_OF_HOLDING)
|
||||
otmp->owt = weight(otmp);
|
||||
else if (otmp->otyp == FIGURINE) {
|
||||
if (otmp->corpsenm != NON_PM
|
||||
&& !dead_species(otmp->corpsenm,TRUE)
|
||||
&& !dead_species(otmp->corpsenm,TRUE)
|
||||
&& (carried(otmp) || mcarried(otmp)))
|
||||
attach_fig_transform_timeout(otmp);
|
||||
}
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user