I could use some help with PT_METL

  • reissi
    18th Aug 2010 Member 0 Permalink
    I ran into a problem while trying to add some basic elements today.
    I included rust as a new element and tried to code the interaction between metal and saltwater.

    else if(t==PT_SLTW)
    [...]
    else if(((r&0xFF)==PT_METL && 1>(rand()%7000)) || ((r&0xFF)==PT_BRMT && 1>(rand()%700)))
    {
    parts[r>>8].type = PT_RUST;
    }

    It works fine with any element I use, broken metal, breakable metal, NSCN, wood, etc...

    But it will not corrode PT_METL, whatever I do.

    Also going the other way round, (if (t==PT_METL)(do something)) doesn't react in any way.

    Where is my error?
  • ief015
    18th Aug 2010 Former Staff 0 Permalink
    common mistake. Use PT_WIRE for metal. PT_METL is actually stone.
  • zc00gii
    18th Aug 2010 Banned 0 Permalink
    This post is hidden because the user is banned
  • zc00gii
    18th Aug 2010 Banned 0 Permalink
    This post is hidden because the user is banned
  • reissi
    18th Aug 2010 Member 0 Permalink
    Thanks alot!
    That'll help