Merge release-4-5-patches into release-4-6
[alexxy/gromacs.git] / src / gmxlib / mshift.c
index 17f057418c21fecd0d24b4891d35e18523af1531..0aae993a3275e6e38e26f3434223c93e6f1ff150 100644 (file)
@@ -98,7 +98,7 @@ static void mk_igraph(t_graph *g,int ftype,t_ilist *il,
     np = interaction_function[ftype].nratoms;
     
     if (ia[1] >= at_start && ia[1] < at_end) {
-      if (ia[np] >= at_end)
+      if (ia[np] >= at_end || (ftype == F_SETTLE && ia[1]+2 >= at_end))
        gmx_fatal(FARGS,
                  "Molecule in topology has atom numbers below and "
                  "above natoms (%d).\n"