I have done it now, I made an element that runs faster than the stupid simulation engine. Therefore, causing everything to malfunction. It's definatively detecting the microsecond reset of the simulation between frames when a conductor turns back to spark in between spark segments. However, when it reacts to this, it last for a normal frame but the external conditions have by then returned to normal making it's current state impossible, so it crashes. I've done everything I can with the code, (getting close to moving solid nasty), but I still have this malfunction, which is caused by these dualing if() checks:
while((r&0xFF)==PT_SPRK && parts[r>>8].ctype==PT_PSCN)
{
parts[i].life++;
parts[i].tmp2=1;
parts[i].tmp=1;
parts[i].ctype=PT_BTRY;
break;
}
while((r&0xFF)==PT_PSCN && parts[r>>8].life<=0 && (r&0xFF)!=PT_SPRK)
{
parts[i].tmp=0;
parts[i].tmp2=0;
break;
}
EDIT: It's reaction is the tmp values flipping to zero with a spark segment of 4 life right next to it, meaning it changed between frames.