Permalink
Browse files

remove unused PSTN code (is this a sign of a bug?)

  • Loading branch information...
jacob1 committed Apr 21, 2017
1 parent 7078d7e commit 01d17cb860e465a3d053b5abee7878f3ea2814c9
Showing with 1 addition and 4 deletions.
  1. +1 −4 src/simulation/elements/PSTN.cpp
@@ -223,7 +223,6 @@ Element_PSTN::StackData Element_PSTN::CanMoveStack(Simulation * sim, int stackX,
//#TPT-Directive ElementHeader Element_PSTN static int MoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block, bool sticky, int callDepth = 0)
int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int directionX, int directionY, int maxSize, int amount, bool retract, int block, bool sticky, int callDepth)
{
bool foundParts = false;
int posX, posY, r;
r = sim->pmap[stackY][stackX];
if(!callDepth && (r&0xFF) == PT_FRME) {
@@ -277,11 +276,11 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
return MoveStack(sim, stackX, stackY, directionX, directionY, maxSize, amount, retract, block, !sim->parts[sim->pmap[stackY][stackX]>>8].tmp, 1);
}
if(retract){
bool foundParts = false;
//Remove arm section if retracting without FRME
if (!callDepth)
for(int j = 1; j <= amount; j++)
sim->kill_part(sim->pmap[stackY+(directionY*-j)][stackX+(directionX*-j)]>>8);
bool foundEnd = false;
int currentPos = 0;
for(posX = stackX, posY = stackY; currentPos < maxSize && currentPos < XRES-1; posX += directionX, posY += directionY) {
if (!(posX < XRES && posY < YRES && posX >= 0 && posY >= 0)) {
@@ -308,8 +307,6 @@ int Element_PSTN::MoveStack(Simulation * sim, int stackX, int stackY, int direct
}
return amount;
}
if(!foundParts && foundEnd)
return amount;
} else {
StackData stackData = CanMoveStack(sim, stackX, stackY, directionX, directionY, maxSize, amount, retract, block);
int currentPos = stackData.pushed + stackData.spaces;

0 comments on commit 01d17cb

Please sign in to comment.