if (ETC_ANDERSEN(ir->etc) && EI_VV(ir->eI))
{
gmx_bool bDoAndersenConstr;
- bDoAndersenConstr = update_randomize_velocities(ir,step,mdatoms,state,upd,&top->idef,constr);
+ bDoAndersenConstr = (constr && update_randomize_velocities(ir,step,mdatoms,state,upd,&top->idef,constr));
/* if we have constraints, we have to remove the kinetic energy parallel to the bonds */
if (bDoAndersenConstr)
{