Skip to content

Commit

Permalink
remove unused PSTN code (is this a sign of a bug?)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Apr 21, 2017
1 parent 7078d7e commit 01d17cb
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/simulation/elements/PSTN.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down

0 comments on commit 01d17cb

Please sign in to comment.