Spark crash?

  • Neospector
    29th Mar 2011 Member 0 Permalink
    If you've seen me on IRC you know about this. I'm having trouble with two elements, POST and NEGA.
    POST is designed as a positive Metallic object, NEGA as a negative metallic object. While I was making electrolysis I realized that it'd be redundant to make HYDR (hydrogen) and O2 (Oxygen) with IRON if they'd just combine again. So, I remembered my school's electrolysis experiment:
    Hydrogen came out of the tube with one type of current, oxygen the other.
    So I made these two to allow for separate chambers to create both gasses. The problem is that when either two are sparked, the game freezes and wont move. I have put in PROP_CONDUCTS for both elements, it's just when spark touches it the game freezes. No idea why. I'm hoping more people see this than on IRC.
  • PizzaPlatypus
    29th Mar 2011 Member 0 Permalink
    @Neospector
    I'm not sure if PROP_CONDUCTS has been properly added yet, if your using code before 46.4, you'll have to add it to all the conducting lists in powder.c (search metl in powder.c and add your element to any of the lists you find).
  • Neospector
    29th Mar 2011 Member 0 Permalink
    @PizzaPlatypus
    Pardon me for not responding, but school and tennis take their toll.
    Anyway, The spark isn't in there in my version.
    if ((ptypes[t].properties&PROP_CONDUCTS) || t==PT_SPRK)
    {
    nx = x % CELL;
    if (nx == 0)
    nx = x/CELL - 1;
    else if (nx == CELL-1)
    nx = x/CELL + 1;
    else
    nx = x/CELL;
    ny = y % CELL;
    if (ny == 0)
    ny = y/CELL - 1;
    else if (ny == CELL-1)
    ny = y/CELL + 1;
    else
    ny = y/CELL;
    if (nx>=0 && ny>=0 && nx {
    if (t!=PT_SPRK)
    {
    if (emap[ny][nx]==12 && !parts[i].life)
    {
    part_change_type(i,x,y,PT_SPRK);
    parts[i].life = 4;
    parts[i].ctype = t;
    t = PT_SPRK;
    }
    }

    It looks like PROP_CONDUCTS is in there.