Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Atom/AtomicInfo.cpp

    r7e51e1 rd05088  
    8888  bool status = true;
    8989  if (_atom.getId() != Id)
    90     status = _atom.changeId(Id);
     90    status &= _atom.changeId(Id);
    9191
    9292  // set its father
    93   atom * const _father = World::getInstance().getAtom(AtomById(FatherId));
    94   if (_father == NULL)
    95     _atom.father = &_atom;
    96   else
    97     _atom.father = _father;
     93  if (status) {
     94    atom * const _father = World::getInstance().getAtom(AtomById(FatherId));
     95    if ((_father == NULL) || (Id == FatherId)) {
     96      _atom.father = &_atom;
     97      // don't sign on
     98    } else {
     99      _atom.father = _father;
     100      _father->signOn(&_atom);
     101    }
    98102
    99   // setting molecule
    100   molecule * const _mol = World::getInstance().getMolecule(MoleculeById(MolId));
    101   if (_mol != NULL)
    102     _atom.setMolecule(_mol); // this is ok, mol is const within AtomicInfo, but not outside (atoms need to register)
    103   _atom.changeNr(Nr);
     103    // setting molecule
     104    molecule * const _mol = World::getInstance().getMolecule(MoleculeById(MolId));
     105    if (_mol != NULL)
     106      _atom.setMolecule(_mol); // this is ok, mol is const within AtomicInfo, but not outside (atoms need to register)
     107    _atom.changeNr(Nr);
     108  }
    104109
    105110  return status;
Note: See TracChangeset for help on using the changeset viewer.