Code copying

  • PizzaPlatypus
    15th Jan 2011 Member 0 Permalink
    My old mod used old code so I have copied the code over to new code and tweaked it slightly however my lava bomb code doesn't work here it is:
    else if(t==PT_LBMB)
    {
    for(nx=-2; nx<3; nx++)
    for(ny=-2; ny<3; ny++)
    if(x+nx>=0 && y+ny>0 && x+nx<XRES && y+ny<YRES && (nx || ny))
    {
    r = pmap[y+ny][x+nx];
    if((r>>8)>=NPART || !r)
    continue;
    if((r&0xFF)!=PT_LBMB)
    {
    t = parts[i].type = PT_LAVA;
    parts[i].ctype = PT_BMTL;
    parts[i].temp = 8500.0f;
    pv[y/CELL][x/CELL] += 50.0f;
    }
    }
    }
    Can you help!
  • MiXih
    15th Jan 2011 Member 0 Permalink
    you changed PT_NUM?
  • PizzaPlatypus
    15th Jan 2011 Member 0 Permalink
    yup
  • Felix
    15th Jan 2011 Member 0 Permalink
    What doesn't work?
  • PizzaPlatypus
    15th Jan 2011 Member 0 Permalink
    it doesn't explode on contact or turn inot lava or get hot
  • Xenocide
    15th Jan 2011 Former Staff 0 Permalink
    is it in the right place?

    The right place being in update_particles in powder.c
  • Pilihp64
    15th Jan 2011 Developer 0 Permalink
    update_particles_i
  • PizzaPlatypus
    15th Jan 2011 Member 0 Permalink
    yep it's there
  • Felix
    15th Jan 2011 Member 0 Permalink
    Use a pastebin for your code, also provide some of the context.
  • PizzaPlatypus
    15th Jan 2011 Member 0 Permalink
    Ok here it is with context:
    http://pastebin.com/Fy7hqgW9