{
if (atoms != null)
{
+ // we set the globalUseScriptWait (and reset to previous value) only if
+ // we're going to use it here
boolean useScriptWait = atoms.size() > 1;
- boolean prevUseScriptWait = setGlobalUseScriptWait(useScriptWait);
+ boolean prevUseScriptWait = false;
+ if (useScriptWait)
+ prevUseScriptWait = setGlobalUseScriptWait(useScriptWait);
if (resetLastRes.length() > 0)
{
- jmolScript(resetLastRes.toString());
+ jmolScript(resetLastRes.toString(), useScriptWait);
resetLastRes.setLength(0);
}
for (AtomSpec atom : atoms)
highlightAtom(atom.getAtomIndex(), atom.getPdbResNum(),
atom.getChain(), atom.getPdbFile(), useScriptWait);
}
- setGlobalUseScriptWait(prevUseScriptWait);
+ if (useScriptWait)
+ setGlobalUseScriptWait(prevUseScriptWait);
}
}