From psmithnews@spod-central.org Wed Nov  7 10:28:28 2001
Path: ulcc.ac.uk!server3.netnews.ja.net!newspeer.clara.net!news.clara.net!dispose.news.demon.net!news.demon.co.uk!demon!strackenz.spod-central.org!not-for-mail
From: psmithnews@spod-central.org (Dylan O'Donnell)
Newsgroups: rec.games.roguelike.nethack
Subject: Re: Program in disorder (Eek!)
Date: 05 Nov 2001 14:33:11 +0000
Organization: Spod Central
Sender: psmith@strackenz.spod-central.org
Message-ID: <86k7x5fftk.fsf@strackenz.spod-central.org>
References: <pd%E7.5189$9M2.458984@news.xtra.co.nz> <3BE4978D.150B5D52@verizon.net> <86ofmhfrw9.fsf@strackenz.spod-central.org> <slrn.pl.9ud59p.61o.tometzky@pancernik.batory.org.pl>
Reply-To: psmith@spod-central.org
NNTP-Posting-Host: strackenz.spod-central.org
X-NNTP-Posting-Host: strackenz.spod-central.org:62.49.128.252
X-Trace: news.demon.co.uk 1004970795 nnrp-13:15757 NO-IDENT strackenz.spod-central.org:62.49.128.252
X-Complaints-To: abuse@demon.net
User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Lines: 46
Xref: ulcc.ac.uk rec.games.roguelike.nethack:150921

Tomasz Ostrowski <tometzky@students.mimuw.edu.pl> writes:
> On 05 Nov 2001 10:12:22 +0000, Dylan O'Donnell wrote:
> 
> >  (I posted a fix a few weeks ago, which Ali Harlow archived on his
> >  site at http://avrc.city.ac.uk/nethack/ODonnell/c331-30.patch )
> 
> I do not understand this patch.

[snip brown-paper-bag error]

Thank you. You're supposed to point out my idiotic mistakes,
people.


--- nethack-3.3.1/src/weapon.c  Thu Aug 31 12:33:50 2000
+++ nethack-3.3.1bis/src/weapon.c       Mon Nov  5 14:29:00 2001
@@ -1008,9 +1008,9 @@
        }
     } else if (type == P_TWO_WEAPON_COMBAT) {
        skill = P_SKILL(P_TWO_WEAPON_COMBAT);
-       if (P_SKILL(weapon->otyp) < skill) skill = P_SKILL(weapon->otyp);
+       if (P_SKILL(weapon_type(weapon)) < skill) skill = P_SKILL(weapon_type(weapon));
        switch (skill) {
-           default: impossible(bad_skill, P_SKILL(type)); /* fall through */
+           default: impossible(bad_skill, skill); /* fall through */
            case P_ISRESTRICTED:
            case P_UNSKILLED:   bonus = -9; break;
            case P_BASIC:       bonus = -7; break;
@@ -1064,9 +1064,10 @@
        }
     } else if (type == P_TWO_WEAPON_COMBAT) {
        skill = P_SKILL(P_TWO_WEAPON_COMBAT);
-       if (P_SKILL(weapon->otyp) < skill) skill = P_SKILL(weapon->otyp);
+       if (P_SKILL(weapon_type(weapon)) < skill) skill = P_SKILL(weapon_type(weapon));
        switch (skill) {
-           default:
+           default:  impossible("weapon_dam_bonus: bad skill %d", skill);
+                     /* fall through */
            case P_ISRESTRICTED:
            case P_UNSKILLED:   bonus = -3; break;
            case P_BASIC:       bonus = -1; break;

-- 
:  Dylan O'Donnell                     http://www.spod-central.org/~psmith/  :
:   microHamlet: the average coherency of prose created by a single monkey   :
:   typing randomly on a keyboard. Usenet postings may be measured in uHm.   :

