]> granicus.if.org Git - nethack/commitdiff
R677 - two swords slipping due to fried food prints same message
authorcohrs <cohrs>
Mon, 25 Mar 2002 07:48:03 +0000 (07:48 +0000)
committercohrs <cohrs>
Mon, 25 Mar 2002 07:48:03 +0000 (07:48 +0000)
- report: twoweapon mode, eat fried food, get messages like:
Your sword slips from your hands.
Your sword also slips from your hands.
- the fix tracks the kind of the 1st weapon, and adds "other" to the 2nd
message if necessary

doc/fixes34.1
src/do_wear.c

index 7137dce007d7374079045d879a8c22d0796864ce..f64340949f787800d8527ff25a3aa9023e2e2c52 100644 (file)
@@ -15,6 +15,7 @@ two bad wizkit items in a row shouldn't make the user hit space many times
 kicking thrones no longer loosens rocks
 wall symbol not replaced when digging while blind and levitating
 print regular death message when leashed, mounted steed dies of starvation
+fix more funny messages, new and old
 
 
 Platform- and/or Interface-Specific Fixes
index d361696b19d911e38f22762b1edf9be387c48928..b4363c55da953d9f696c65cbe50c7e21fc976132 100644 (file)
@@ -1553,6 +1553,7 @@ glibr()
        register struct obj *otmp;
        int xfl = 0;
        boolean leftfall, rightfall;
+       const char *otherwep = 0;
 
        leftfall = (uleft && !uleft->cursed &&
                    (!uwep || !welded(uwep) || !bimanual(uwep)));
@@ -1577,9 +1578,10 @@ glibr()
 
        otmp = uswapwep;
        if (u.twoweap && otmp) {
+               otherwep = is_sword(otmp) ? c_sword :
+                   makesingular(oclass_names[(int)otmp->oclass]);
                Your("%s %sslips from your %s.",
-                       is_sword(otmp) ? c_sword :
-                               makesingular(oclass_names[(int)otmp->oclass]),
+                       otherwep,
                        xfl ? "also " : "",
                        makeplural(body_part(HAND)));
                setuswapwep((struct obj *)0);
@@ -1589,10 +1591,16 @@ glibr()
        }
        otmp = uwep;
        if (otmp && !welded(otmp)) {
+               const char *thiswep;
+
+               /* nice wording if both weapons are the same type */
+               thiswep = is_sword(otmp) ? c_sword :
+                   makesingular(oclass_names[(int)otmp->oclass]);
+               if (otherwep && strcmp(thiswep, otherwep)) otherwep = 0;
+
                /* changed so cursed weapons don't fall, GAN 10/30/86 */
-               Your("%s %sslips from your %s.",
-                       is_sword(otmp) ? c_sword :
-                               makesingular(oclass_names[(int)otmp->oclass]),
+               Your("%s%s %sslips from your %s.",
+                       otherwep ? "other " : "", thiswep,
                        xfl ? "also " : "",
                        makeplural(body_part(HAND)));
                setuwep((struct obj *)0);