]> granicus.if.org Git - nethack/commitdiff
fix more "drops to the floor" cases when there is no floor
authorcohrs <cohrs>
Sun, 31 Mar 2002 04:18:02 +0000 (04:18 +0000)
committercohrs <cohrs>
Sun, 31 Mar 2002 04:18:02 +0000 (04:18 +0000)
- make the code in apply.c and zap.c consistent
- use the "drops away from you" case whenever the location type does not
lend itself to using the word "floor"

src/apply.c
src/zap.c

index 1b4dad81c818e8ec46807f801c4a924bb67ff771..6eaf53dd4777a0013f15793d6658d25756758831 100644 (file)
@@ -2798,9 +2798,12 @@ doapply()
                    otmp->blessed = obj->blessed;
                    otmp->cursed = obj->cursed;
                    otmp->owt = weight(otmp);
-                   otmp = hold_another_object(otmp,
-                                       (u.uswallow || Is_airlevel(&u.uz) ||
-                                        u.uinwater || Is_waterlevel(&u.uz)) ?
+                   otmp = hold_another_object(otmp, u.uswallow ?
+                                      "Oops!  %s out of your reach!" :
+                                       (Is_airlevel(&u.uz) ||
+                                        Is_waterlevel(&u.uz) ||
+                                        levl[u.ux][u.uy].typ < IRONBARS ||
+                                        levl[u.ux][u.uy].typ >= ICE) ?
                                               "Oops!  %s away from you!" :
                                               "Oops!  %s to the floor!",
                                               The(aobjnam(otmp, "slip")),
index ca26d524c4248c4e51a90c0267794ac0236d99e4..2d2ccc40f69f4b3c3186b5a33a09e2612aa139cf 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -4073,7 +4073,10 @@ retry:
                /* The(aobjnam()) is safe since otmp is unidentified -dlc */
                (void) hold_another_object(otmp, u.uswallow ?
                                       "Oops!  %s out of your reach!" :
-                                      Is_airlevel(&u.uz) || u.uinwater ?
+                                      (Is_airlevel(&u.uz) ||
+                                       Is_waterlevel(&u.uz) ||
+                                       levl[u.ux][u.uy].typ < IRONBARS ||
+                                       levl[u.ux][u.uy].typ >= ICE) ?
                                       "Oops!  %s away from you!" :
                                       "Oops!  %s to the floor!",
                                       The(aobjnam(otmp,