diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 7705601758..cf76b9b0e5 100755 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -446,10 +446,12 @@ void FixBondCreate::post_integrate() // increment bondcount, convert atom to new type if limit reached bondcount[i]++; - if (type[i] == iatomtype) + int oldtype = type[i]; + if (type[i] == iatomtype) { if (bondcount[i] == imaxbond) type[i] = inewtype; - else + } else { if (bondcount[i] == jmaxbond) type[i] = jnewtype; + } // count the created bond once