My code isn't working??

  • tommig
    12th Nov 2011 Member 0 Permalink
    Hi guys!
    I've been trying to code an indistrucable metal, by bombarding lava (titanium) with neutrons

    However, since the IMTL can't melt, I can't use lava transitions to code it.
    I have to cool it down to way below 1000C to solidify it because it uses the standard lava transition code.

    I've used this code to get around it, but it doesn't work, can you please tell me why
    'powder.c'

    if(t==PT_LAVA) {
    if (parts[i].ctype==PT_IMTL) {
    if (parts[i].temp<2000) {<br/>parts[i].type==(PT_IMTL);
    }
    }
    }

    Thanks
    Tommig
  • jacksonmj
    12th Nov 2011 Developer 0 Permalink
    If I understand correctly, you want lava with ctype==PT_IMTL to solidify at a temperature of 2000 K.

    In powder.c, find the line:
    if (parts[i].ctype==PT_THRM&&pt>=ptransitions[PT_BMTL].thv) s = 0;
    After it, add:
    else if (parts[i].ctype==PT_IMTL&&pt<2000) s = 1;

    pt is the particle temperature. If s = 1 in that bit of the code, then the lava will solidify.
  • tommig
    12th Nov 2011 Member 0 Permalink
    @jacksonmj (View Post)
    Yep, that worked!
    Thanks!