OMGOMG!!!

  • china-richway2
    28th Sep 2013 Member 0 Permalink

    Here is a save I made:

     

    Use 89.0 beta version: FRME on the top broke.

    Use 88.1 release version: PSTN has something wrong with it:

     

    EDIT: I changed PSTN.cpp and it seems to work perfectly on both bugs: (Hope it works, I'm not very sure)

    //#TPT-Directive ElementHeader Element_PSTN static int CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
    int Element_PSTN::CanMoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block)
    {
     int posX, posY, r, spaces = 0, currentPos = 0, num = 0;
     if (amount <= 0)
      return 0;
     for(posX = stackX, posY = stackY; currentPos < maxSize + amount && currentPos < XRES-1; posX += directionX, posY += directionY) {
      if (!(posX < XRES && posY < YRES && posX >= 0 && posY >= 0)) {
       break;
      }
      r = sim->pmap[posY][posX];
      if (sim->IsWallBlocking(posX, posY, 0) || (block && (r&0xFF) == block))
       return num;
      if(!r) {
       spaces++;
       tempParts[currentPos++] = -1;
       if(spaces >= amount)
        break;
      } else {
       if(spaces < maxSize && currentPos < maxSize && (!retract || ((r&0xFF) == PT_FRME) && posX == stackX && posY == stackY))
        tempParts[currentPos++] = r>>8;
       /*else
        return num;*/
      }
      num++;
     }
     if (spaces)
      return currentPos;
     else
      return 0;
    }

    Edited 10 times by china-richway2. Last: 28th Sep 2013
  • jacob1
    28th Sep 2013 Developer 0 Permalink
    PSTN has always been almost impossible to get working, trying to make sure all FRME stays together every time is hard because if I change one thing, it breaks another. I'll look into why it breaks in the beta, although it seems fine for me in the release one. Note that you have PSTN(WIFI) in the first and PSTN(GLAS) in the second, this sets it's "stopper" element. It seems like you already knew this though.

    Edit: also what is the bug in the beta in the second save? In that I only see the bug in the release, which is the original bug I was trying to fix when I broke the beta one.
    Edited once by jacob1. Last: 28th Sep 2013
  • china-richway2
    29th Sep 2013 Member 0 Permalink

    @jacob1 Spark PSCN. PSTN should push until GLAS but... Yes, I already know knew known this.

    Beta one: Spark that button and wait. You can see that FRME breaks.

    Also you can try use my code, I tested and both didn't get glitchy.

    Edited 2 times by china-richway2. Last: 29th Sep 2013