mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-01 06:00:15 +02:00
remove unused PSTN code (is this a sign of a bug?)
This commit is contained in:
@@ -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)
|
//#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)
|
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;
|
int posX, posY, r;
|
||||||
r = sim->pmap[stackY][stackX];
|
r = sim->pmap[stackY][stackX];
|
||||||
if(!callDepth && (r&0xFF) == PT_FRME) {
|
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);
|
return MoveStack(sim, stackX, stackY, directionX, directionY, maxSize, amount, retract, block, !sim->parts[sim->pmap[stackY][stackX]>>8].tmp, 1);
|
||||||
}
|
}
|
||||||
if(retract){
|
if(retract){
|
||||||
|
bool foundParts = false;
|
||||||
//Remove arm section if retracting without FRME
|
//Remove arm section if retracting without FRME
|
||||||
if (!callDepth)
|
if (!callDepth)
|
||||||
for(int j = 1; j <= amount; j++)
|
for(int j = 1; j <= amount; j++)
|
||||||
sim->kill_part(sim->pmap[stackY+(directionY*-j)][stackX+(directionX*-j)]>>8);
|
sim->kill_part(sim->pmap[stackY+(directionY*-j)][stackX+(directionX*-j)]>>8);
|
||||||
bool foundEnd = false;
|
|
||||||
int currentPos = 0;
|
int currentPos = 0;
|
||||||
for(posX = stackX, posY = stackY; currentPos < maxSize && currentPos < XRES-1; posX += directionX, posY += directionY) {
|
for(posX = stackX, posY = stackY; currentPos < maxSize && currentPos < XRES-1; posX += directionX, posY += directionY) {
|
||||||
if (!(posX < XRES && posY < YRES && posX >= 0 && posY >= 0)) {
|
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;
|
return amount;
|
||||||
}
|
}
|
||||||
if(!foundParts && foundEnd)
|
|
||||||
return amount;
|
|
||||||
} else {
|
} else {
|
||||||
StackData stackData = CanMoveStack(sim, stackX, stackY, directionX, directionY, maxSize, amount, retract, block);
|
StackData stackData = CanMoveStack(sim, stackX, stackY, directionX, directionY, maxSize, amount, retract, block);
|
||||||
int currentPos = stackData.pushed + stackData.spaces;
|
int currentPos = stackData.pushed + stackData.spaces;
|
||||||
|
Reference in New Issue
Block a user