]> granicus.if.org Git - nethack/commitdiff
glob tweak
authorPatR <rankin@nethack.org>
Fri, 29 Apr 2016 08:39:03 +0000 (01:39 -0700)
committerPatR <rankin@nethack.org>
Fri, 29 Apr 2016 08:39:03 +0000 (01:39 -0700)
Sometime back I oversimplified this bit of code to the point where
the impossible(), if ever triggered, would have been followed by a
crash.

src/mkobj.c

index 3574eaece6ac88d437268506cb4348943734da91..301fa847d12e87a9a407143ac9402320f2bffadd 100644 (file)
@@ -2587,9 +2587,10 @@ struct obj *
 obj_nexto(otmp)
 struct obj *otmp;
 {
-    if (!otmp)
+    if (!otmp) {
         impossible("obj_nexto: wasn't given an object to check");
-
+        return (struct obj *) 0;
+    }
     return obj_nexto_xy(otmp, otmp->ox, otmp->oy, TRUE);
 }