From 01d17cb860e465a3d053b5abee7878f3ea2814c9 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Thu, 20 Apr 2017 21:16:25 -0400 Subject: [PATCH] remove unused PSTN code (is this a sign of a bug?) --- src/simulation/elements/PSTN.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/simulation/elements/PSTN.cpp b/src/simulation/elements/PSTN.cpp index 699d8aad2..5ff7c6a89 100644 --- a/src/simulation/elements/PSTN.cpp +++ b/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;