mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-03-31 04:22:59 +02:00
remove unused PSTN code (is this a sign of a bug?)
This commit is contained in:
parent
7078d7e528
commit
01d17cb860
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user