@randal, True. But to make it more realistic. In a thread in previous I had made, I state that I like things realistic, and pressure can be turned into electricity and so can heat.
Try cutting them all down to one element. A DTCT element. It gets the right-clicked element when drawn, and if it's either HEAT, COOL, AIR or VACU, it sets its tmp respectively. The tmp sets the type of loop that is run on each frame. int update_DTCT(UPDATE_FUNC_ARGS, int sr) { if(parts[i].type == PT_DTCT) { /* This code goes to draw particle function if(sr == SPC_HEAT || sr = SPC_COOL || sr == SPC_VACUUM || sr == SPC_AIR) { switch sr { case SPC_HEAT : parts[i].tmp = 1; break; case SPC_COOL : parts[i].tmp = 2; break; case SPC_VACUUM : parts[i].tmp = 3; break; case SPC_AIR : parts[i].tmp = 4; break; default : parts[i].tmp = 0; break; // - Or something similar - }*/ // The below code is for the update loop if(parts[i].tmp == 1) if(parts[i].temp > 1273.15f) /* Sparking code */ else if(parts[i].tmp == 2) if(parts[i].temp < 100.0f) /* Sparking code */ if(parts[i].tmp == 3) if(pv[y/CELL][x/CELL] < -50.0f) /* Sparking code */ else if(parts[i].tmp == 4) if(pv[y/CELL][x/CELL] > 50.0f) /* Sparking code */