Make more division checks safer
authorYesterday's Voyage <startrekkin@startrekkin.net>
Sun, 15 Feb 2009 19:27:23 +0000 (19:27 +0000)
committerYesterday's Voyage <startrekkin@startrekkin.net>
Sun, 15 Feb 2009 19:27:23 +0000 (19:27 +0000)
src/destroy.c

index 0867036cb8d92a47eaf558eda0a040efa5d43012..0c23386b3475488af8ca285190a1bb64c33d9b35 100644 (file)
@@ -1056,7 +1056,7 @@ check_divisions(void) {
 
       /* make sure their division is a valid object */
       if((!GoodObject(Division(i)) && Division(i) != NOTHING)
-        || IsGarbage(Division(i))) {
+        || (GoodObject(Division(i)) && IsGarbage(Division(i)))) {
        Division(i) = NOTHING;
        do_rawlog(LT_ERR, T("ERROR: Bad Division(#%d) set on object #%d"),
                  Division(i), i);