This was a problematic place - (unsigned) - (unsigned) is causing compilation errors.
(abs is not compiling due to many possible overloads)

I'll replace it with id1==id2+1 || id1+1==id2.